You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should print '1 0 0' however the .x += 1 expression binds to the literal '0 0 0' instead of e.vec which overwrites the immediate. Using literal '0 0 0' anywhere now will actually become '1 0 0'. This is true for anything on the right hand side of the entfield assignment, other globals, or entfields will be overwritten too.
The text was updated successfully, but these errors were encountered:
graphitemaster
changed the title
entfield expressions can overwrite immediates and globals table
entfield expressions and ast_member expressions can overwrite immediates and globals table
Nov 27, 2017
This behavior also manifests for arrays too. We shuffle the regular parsing rules for ent.foo[n] to behave as ent.(foo[n]) opposed to (ent.foo)[n], as it should by the binding logic does not follow suit, instead (ent.foo[n] = '0 0 0').x += 1 binds to the literal n and causes a compiler error.
Minimal test case
This should print '1 0 0' however the .x += 1 expression binds to the literal '0 0 0' instead of
e.vec
which overwrites the immediate. Using literal '0 0 0' anywhere now will actually become '1 0 0'. This is true for anything on the right hand side of the entfield assignment, other globals, or entfields will be overwritten too.The text was updated successfully, but these errors were encountered: