Expected behavior
A compile-time % with a zero divisor should emit a clean error[T3001]
division-by-zero diagnostic, exactly like the other operators / and \ do.
The bug
% on a zero divisor panics the compiler (Rust panic, exit code 101) with no
source location, instead of emitting T3001.
template T() {
var v = 5 % 0; // panics
}
component main = T();
thread 'main' panicked at num-bigint-dig-0.8.4/src/algorithms/div.rs:38:9: explicit panic
circom exit status: 101
For contrast, var v = 5 / 0; in the same position emits error[T3001] and exits 1.
Expected behavior
A compile-time
%with a zero divisor should emit a cleanerror[T3001]division-by-zero diagnostic, exactly like the other operators
/and\do.The bug
%on a zero divisor panics the compiler (Rust panic, exit code 101) with nosource location, instead of emitting
T3001.For contrast,
var v = 5 / 0;in the same position emitserror[T3001]and exits 1.