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

expressions involving timeof(label) and offsetof(label) evaluate at runtime #50

Open
ExpHP opened this issue Oct 22, 2021 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ExpHP
Copy link
Owner

ExpHP commented Oct 22, 2021

// original
+6:
label:
sprite(sprite0 + timeof(label) + 3);

// decompiled
+6:
I0 = 0 + 6;
I0 = I0 + 3;
sprite(I0);

The fact that this evaluates at runtime might come as a surprise to users. However, evaluating timeof/offsetof as const would be challenging to support...

Perhaps it should just generate an error for now to use timeof/offsetof with operators...

@ExpHP ExpHP added the bug Something isn't working label Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant