Merge pull request #998 from Zokrates/uint-bugfix
Remove cast to usize causing wrong values in wasm environment
This commit is contained in:
commit
af704063ca
2 changed files with 2 additions and 1 deletions
1
changelogs/unreleased/998-dark64
Normal file
1
changelogs/unreleased/998-dark64
Normal file
|
@ -0,0 +1 @@
|
|||
Fix invalid cast to `usize` which caused wrong values in 32-bit environments
|
|
@ -1465,7 +1465,7 @@ impl<'ast, T: Field> Flattener<'ast, T> {
|
|||
|
||||
let res = match expr.into_inner() {
|
||||
UExpressionInner::Value(x) => {
|
||||
FlatUExpression::with_field(FlatExpression::Number(T::from(x as usize)))
|
||||
FlatUExpression::with_field(FlatExpression::Number(T::from(x)))
|
||||
} // force to be a field element
|
||||
UExpressionInner::Identifier(x) => {
|
||||
let field = FlatExpression::Identifier(*self.layout.get(&x).unwrap());
|
||||
|
|
Loading…
Reference in a new issue