Skip to content

fix: use correct panic code in buffer bounds checks#1859

Open
sakirr05 wants to merge 1 commit intohyperledger-solang:mainfrom
sakirr05:fix/buffer-validator-panic-code
Open

fix: use correct panic code in buffer bounds checks#1859
sakirr05 wants to merge 1 commit intohyperledger-solang:mainfrom
sakirr05:fix/buffer-validator-panic-code

Conversation

@sakirr05
Copy link
Copy Markdown

BufferValidator was emitting Panic(0x00) (Generic) for out-of-bounds reads, but 0x32 (ArrayIndexOob) is what Solidity actually specifies for this case. Debuggers and block explorers use these codes to explain reverts, so the wrong code makes failures harder to trace.

Also cleaned up the two TODO comments that were flagging this.

…Generic with PanicCode::ArrayIndexOob (0x32)

Signed-off-by: Sakirr <sakirahmed690078@gmail.com>
@sakirr05 sakirr05 force-pushed the fix/buffer-validator-panic-code branch 2 times, most recently from 739d7f0 to d5f9954 Compare April 13, 2026 09:36
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