The following circom program crashes the compiler:
pragma circom 2.0.0;
function foo(x) {
var bar[1+1]; // this is the problematic line. `var bar[2];` works
bar[0] = x;
bar[1] = x;
return bar;
}
template Main() {
signal input inp;
signal output out;
var baz[2] = foo(5);
out <== inp + baz[0];
}
component main {public [inp]} = Main();
with the error message:
thread 'main' panicked at compiler/src/hir/merger.rs:652:13:
internal error: entered unreachable code
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
To reproduce, simply copy the above into a file bug.circom and run
$ circom --r1cs bug.circom
Circom version: 2.1.6, built from source on macOS with rustc 1.73.0
The following circom program crashes the compiler:
with the error message:
To reproduce, simply copy the above into a file
bug.circom
and runCircom version: 2.1.6, built from source on macOS with rustc 1.73.0