Skip to content

Fix panic when Lua integer is out of range of destination type#224

Merged
robbielyman merged 1 commit into
natecraddock:mainfrom
skk64:integer-bugfix
Jul 23, 2026
Merged

Fix panic when Lua integer is out of range of destination type#224
robbielyman merged 1 commit into
natecraddock:mainfrom
skk64:integer-bugfix

Conversation

@skk64

@skk64 skk64 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Hey, I found this bug when using toAny with structs that have u8 types. For example, the following code panics:

try l.doString("MyInt = 256");
_ = l.getGlobal("MyInt");
const my_int = try l.toAny(u8, -1); // Panic!

Changing it to return an error means the host code has the option of handling the error and continue running.

@robbielyman
robbielyman merged commit 89826d2 into natecraddock:main Jul 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants