diff --git a/src/front/spv/function.rs b/src/front/spv/function.rs index 3ab6a97807..a8e97ba615 100644 --- a/src/front/spv/function.rs +++ b/src/front/spv/function.rs @@ -212,11 +212,16 @@ impl> super::Parser { } else { // The only case where the type is different is if we need to treat // unsigned integer as signed. - function.expressions.append(crate::Expression::As { + let old_len = function.expressions.len(); + let handle = function.expressions.append(crate::Expression::As { expr: arg_expr, kind: crate::ScalarKind::Sint, convert: true, - }) + }); + function.body.push(crate::Statement::Emit( + function.expressions.range_from(old_len), + )); + handle }; function.body.push(crate::Statement::Store { pointer: function