Skip to content

OOB shifts in fd_vm_interp_core #3872

@ripatel-fd

Description

@ripatel-fd

Should probably use fd_{uint,ulong}_shift_{left,right} here. Should also check via make -j asm that the resulting bytecode doesn't get less efficient.

src/flamenco/vm/fd_vm_interp_core.c:1049:46: runtime error: shift exponent 4294967295 is too large for 32-bit type 'int'
src/flamenco/vm/fd_vm_interp_core.c:1063:41: runtime error: shift exponent 18446744073709551615 is too large for 64-bit type 'long'
src/flamenco/vm/fd_vm_interp_core.c:1049:46: runtime error: shift exponent 4096 is too large for 32-bit type 'int'

Reproduce using UBSan on Clang

Metadata

Metadata

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions