truth icon indicating copy to clipboard operation
truth copied to clipboard

expressions involving `timeof(label)` and `offsetof(label)` evaluate at runtime

Open ExpHP opened this issue 4 years ago • 0 comments

// 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 avatar Oct 22 '21 05:10 ExpHP