'print' now works as expected
String literals are now stored in the bucket mid-compilation, but this is fine, as the buckets are freed one the bytecode is complete.
This commit is contained in:
+1
-1
@@ -388,7 +388,7 @@ static Toy_AstFlag literal(Toy_Bucket** bucketHandle, Toy_Parser* parser, Toy_As
|
||||
|
||||
buffer[i] = '\0';
|
||||
unsigned int len = i - escapeCounter; //NOTE: len is ONLY the string length
|
||||
Toy_private_emitAstValue(bucketHandle, rootHandle, TOY_VALUE_FROM_STRING(Toy_toStringLength(bucketHandle, buffer, len)));
|
||||
Toy_private_emitAstValue(bucketHandle, rootHandle, TOY_VALUE_FROM_STRING(Toy_createStringLength(bucketHandle, buffer, len))); //BUGFIX: create the string to avoid losing local var 'buffer'
|
||||
|
||||
return TOY_AST_FLAG_NONE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user