Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LHS of a list index is being evaluated before the RHS #1865

Open
wixoaGit opened this issue Jun 29, 2024 · 0 comments
Open

LHS of a list index is being evaluated before the RHS #1865

wixoaGit opened this issue Jun 29, 2024 · 0 comments
Labels
Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime

Comments

@wixoaGit
Copy link
Member

var/list/L = list(null, null)
var/depth = 1

L[depth-1] = ++depth

world.log << json_encode(L)

This should give [2,null] but instead crashes in OD because it evaluates to L[0] = 2 instead of L[1] = 2.
++depth should execute before depth-1.

@wixoaGit wixoaGit added Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime labels Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime
Projects
None yet
Development

No branches or pull requests

1 participant