mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Fixed an obscure compiler bug involving assignments and indexing, read more
TOY_OP_INDEX_ASSIGN_INTERMEDIATE was being used when it shouldn't have. Now the check runs down the whole binary->right branch to ensure the given node doesn't exist in that tree.
This commit is contained in:
10
test/scripts/index-assignment-intermediate-bugfix.toy
Normal file
10
test/scripts/index-assignment-intermediate-bugfix.toy
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
var result; //result must exist to ensure assingment, rather than declaration is invoked by the comparison below
|
||||
|
||||
var lhs = [0];
|
||||
var rhs = [0];
|
||||
|
||||
result = lhs[0] < rhs[0]; //make sure this doesn't invoke TOY_OP_INDEX_ASSIGN_INTERMEDIATE
|
||||
|
||||
|
||||
print "All good";
|
||||
@@ -121,6 +121,7 @@ int main() {
|
||||
"functions.toy",
|
||||
"index-arrays.toy",
|
||||
"index-assignment-both-bugfix.toy",
|
||||
"index-assignment-intermediate-bugfix.toy",
|
||||
"index-assignment-left-bugfix.toy",
|
||||
"index-dictionaries.toy",
|
||||
"index-strings.toy",
|
||||
|
||||
Reference in New Issue
Block a user