Skip to content

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

Open
skk64 wants to merge 1 commit into
natecraddock:mainfrom
skk64:integer-bugfix
Open

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

Conversation

@skk64

@skk64 skk64 commented Jul 11, 2026

Copy link
Copy Markdown

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.

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.

1 participant