kkrt-labs / kakarot-ssj

Kakarot zkEVM - rewrite in the latest version of Cairo
https://www.kakarot.org
MIT License
137 stars 83 forks source link

fix: saturate jumpi index taken on stack #1002

Closed enitrat closed 1 month ago

enitrat commented 1 month ago

Saturates the jumpi index taken on the stack to avoid returning directly if it doesn't fit in a usize.

If b is zero, it will just increment PC. Otherwise, it will be OOB of the bytecode which is capped to 24kb, thus at an invalid jumpdest index.

Closes #971


This change is Reviewable