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

OOB Panic on specific arrangements of LuaJIT-style integer formats (LL/ULL) #133

Closed
Lyrth opened this issue Nov 20, 2023 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@Lyrth
Copy link

Lyrth commented Nov 20, 2023

Clue seems to support LuaJIT-style long integer literals (256ULL, -4LL, etc.), but parsing seems to trip up on certain arrangements of the literal. An example (newline included, works fine if EOF is immediately after ULL):

local a = 2ULL

panics with:

thread 'main' panicked at core\src\scanner.rs:180:18:
index out of bounds: the len is 14 but the index is 14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Different combinations of the lines before and after the usage produce odd results, and even LL's behavior is very different from ULL in terms of what panics or not. There seems to be no clear pattern on how the panic happens, so perhaps the method of parsing should be changed.

Here is a matrix of which arrangements error out (ones highlighted in red):
image

@Maiori44 Maiori44 self-assigned this Nov 21, 2023
@Maiori44 Maiori44 added the bug Something isn't working label Nov 21, 2023
@Maiori44
Copy link
Member

Turns out the issue was the scanner not reading ULL and LL properly.
It has been fixed in 4.0

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

2 participants