The following circuit makes circom crash instead of detecting an out of bounds array access attempt in f.out.
template foo() {
signal input in[2];
signal output out[2];
}
template test() {
signal input a[2];
signal b[2];
component f = foo();
for (var i=0; i<2; i++) { f.in[i] <== a[i]; }
for (var i=0; i<4; i++) { b[i] <== f.out[i]; }
}
component main = test();
Tested on circom 0.5.11, error:
$ ./node_modules/.bin/circom test1.circom
TypeError: Cannot read property 'o' of undefined
at joinSignals (/root/tmp/circom-test/node_modules/circom/src/construction_phase.js:424:27)
at execAssignement (/root/tmp/circom-test/node_modules/circom/src/construction_phase.js:395:17)
at execSignalAssignConstrain (/root/tmp/circom-test/node_modules/circom/src/construction_phase.js:942:15)
at exec (/root/tmp/circom-test/node_modules/circom/src/construction_phase.js:111:20)
at execBlock (/root/tmp/circom-test/node_modules/circom/src/construction_phase.js:535:9)
at exec (/root/tmp/circom-test/node_modules/circom/src/construction_phase.js:192:16)
at execLoop (/root/tmp/circom-test/node_modules/circom/src/construction_phase.js:746:9)
at exec (/root/tmp/circom-test/node_modules/circom/src/construction_phase.js:196:16)
at execBlock (/root/tmp/circom-test/node_modules/circom/src/construction_phase.js:535:9)
at instantiateComponent (/root/tmp/circom-test/node_modules/circom/src/construction_phase.js:522:9)
Cannot read property 'o' of undefined
If the out of bounds error is from a signal inside the component, the proper error is reported:
template test() {
signal input a[2];
signal b[2];
for (var i=0; i<4; i++) { b[i] <== a[i]; }
}
component main = test();
The following circuit makes circom crash instead of detecting an out of bounds array access attempt in
f.out
.Tested on circom 0.5.11, error:
If the out of bounds error is from a signal inside the component, the proper error is reported:
Tested on circom 0.5.11, result: