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 shifts in fd_vm_interp_core #3872

Open
ripatel-fd opened this issue Jan 7, 2025 · 1 comment
Open

OOB shifts in fd_vm_interp_core #3872

ripatel-fd opened this issue Jan 7, 2025 · 1 comment
Assignees
Labels
good first issue Good for newcomers

Comments

@ripatel-fd
Copy link
Contributor

ripatel-fd commented Jan 7, 2025

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

@ripatel-fd
Copy link
Contributor Author

If anyone is interested in working on this one, this is free to take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants