You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The application panicked (crashed).
Message: called `Option::unwrap()` on a `None` valueLocation: crates/noirc_evaluator/src/errors.rs:74This is a bug. We may have already fixed this in newer versions of Nargo so try searching for similar issues at https://github.com/noir-lang/noir/issues/.If there isn't an open issue for this bug, consider opening one at https://github.com/noir-lang/noir/issues/new?labels=bug&template=bug_report.yml
Installation Method
Binary
Nargo Version
nargo 0.9.0 (git version hash: effb02a, is dirty: false)
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered:
Hey @Jurarpereurs, thanks for reporting this. Looks like the issue is that no location is being attached to the < instruction so when this errors then it's unable to show the location of the error which causes the panic.
Once thing I should flag up is that you won't be able to use u253 like this even once this issue is fixed as integer operations could cause the field to overflow. We'll instead just show an error message rather than panic:
// Conservative max bit size that is small enough such that two operands can be
// multiplied and still fit within the field modulus. This is necessary for the
// truncation technique: result % 2^bit_size to be valid.
let max_integer_bit_size = FieldElement::max_num_bits() / 2;
if*bit_size > max_integer_bit_size {
returnErr(RuntimeError::UnsupportedIntegerSize{
num_bits:*bit_size,
max_num_bits: max_integer_bit_size,
location:self.acir_context.get_location(),
});
}
TomAFrench
changed the title
Noir crashes when converting field variables to integers
Panic when attempting to get location for RuntimeError::UnsupportedIntegerSize error
Aug 7, 2023
Aim
I'm trying to convert a field variable to an integer so that I can compare two field variables. However, when I try to do this, Noir crashes:
Expected Behavior
Noir should not crash when converting
Field
tou253
.Bug
Noir panicked when doing
x as u253
, wherex
is aField
variable.To Reproduce
Save the following code into
src/main.nr
:Save the following as input into
Prover.toml
:Run the following command:
You would see the following error message:
Installation Method
Binary
Nargo Version
nargo 0.9.0 (git version hash: effb02a, is dirty: false)
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered: