I encountered a compiler crash when compiling a program with a large constant.
Environment
Compiler version: 0.8.7
Operating system: Ubuntu 22.04.2 LTS
Steps to Reproduce
Save the following code as src.zok:
def main(private field a) {
assert(a > 8000000000000000000000000000000000000000000000000000000000000000000000000000 && a > 1);
}
The compile the code with:
zokrates compile -i src.zok
The compiler will crash with the following error:
Compiling src.zok
The compiler unexpectedly panicked
panicked at 'assertion failed: res.len() <= to', /home/Safarah4783/ZoKrates/zokrates_codegen/src/lib.rs:2020:21
This is unexpected, please submit a full bug report at https://github.com/Zokrates/ZoKrates/issues
However, if you remove the assertion condition that a > 1, the compiler will compile the code successfully.
def main(private field a) {
// Remove the `&& a > 1` part
assert(a > 8000000000000000000000000000000000000000000000000000000000000000000000000000);
}
Description
I encountered a compiler crash when compiling a program with a large constant.
Environment
Steps to Reproduce
Save the following code as
src.zok
:The compile the code with:
The compiler will crash with the following error:
However, if you remove the assertion condition that
a > 1
, the compiler will compile the code successfully.