error in the generated WASM code: "not enough arguments on the stack for i32.mul (need 2, got 1)"
Closed this issue · 1 comments
bkomuves commented
Running the generated WASM witness computation code for the example program below results in the following error:
[CompileError: WebAssembly.compile(): Compiling function #110:"LinearizeArray_0_run" failed: not enough arguments on the stack for i32.mul (need 2, got 1) @+25895]
Try to run circom --c in order to generate c++ code instead
/Users/[...]/witness_calculator.js:11
throw new Error(err);
^
Error: CompileError: WebAssembly.compile(): Compiling function #110:"LinearizeArray_0_run" failed: not enough arguments on the stack for i32.mul (need 2, got 1) @+25895
at builder (/Users/[...]/witness_calculator.js:11:8)
Node.js v17.9.1
circom source code:
pragma circom 2.0.0;
function LinearIndex(w,x,y,z) {
return w*(3*y+x) + z;
}
template LinearizeArray(w) {
var bits = 9*w;
signal input inp[3][3][w];
signal output out[bits];
for(var x=0; x<3; x++) {
for(var y=0; y<3; y++) {
for(var z=0; z<w; z++) {
out[ LinearIndex(w,x,y,z) ] <== inp[x][y][z];
}
}
}
}
component main {public [inp]} = LinearizeArray(3);
file input.json
(doesn't matter, provided only for easier reproducibility):
{ "inp":
[ [ [1,2,3] , [4,5,6] , [7,8,9] ]
, [ [4,5,6] , [7,8,9] , [1,2,3] ]
, [ [7,8,9] , [1,2,3] , [4,5,6] ]
]
}
circom version:
$ circom --version
circom compiler 2.1.5
clararod9 commented
Hi!
We have solved this issue in the last release (v2.1.6). Let us know if the current solution is working for you.
Thank you for reporting the issue!