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

LOADK instruction right after LOADKX instead of an auxiliary parameter #1206

Closed
amitbashan opened this issue Mar 22, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@amitbashan
Copy link

By compiling the following code with optimization level 0:

local a = 123

you will get the bytecode:

0x05, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x03, 0x41,
0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x16, 0x00, 0x01, 0x00, 0x01,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x5E, 0x40, 0x00, 0x01, 0x00,
0x01, 0x18, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00

notice the instruction: 0x41, 0x00, 0x00, 0x00 (0x41 is LOADKX)
the next instruction is: 0x05, 0x00, 0x00, 0x00 (0x5 is LOADK)
but according to comments in Bytecode.h, there should be an auxiliary parameter right after LOADKX, what am I missing here? is this a bug?

@amitbashan amitbashan added the bug Something isn't working label Mar 22, 2024
@amitbashan
Copy link
Author

Luau version 0.617 installed via brew.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant