diff --git a/src/script_opt/ZAM/Expr.cc b/src/script_opt/ZAM/Expr.cc index 4769c587a3..adfc903e20 100644 --- a/src/script_opt/ZAM/Expr.cc +++ b/src/script_opt/ZAM/Expr.cc @@ -1134,8 +1134,10 @@ const ZAMStmt ZAMCompiler::DoCall(const CallExpr* c, const NameExpr* n) { ZInstI z; if ( call_case == 0 ) { - if ( n ) + if ( n ) { z = ZInstI(AssignmentFlavor(OP_CALL0_V, nt), n_slot); + z.SetType(n->GetType()); + } else z = ZInstI(OP_CALL0_X); } @@ -1228,6 +1230,8 @@ const ZAMStmt ZAMCompiler::DoCall(const CallExpr* c, const NameExpr* n) { z = ZInstI(op, n_slot); z.op_type = OP_V; } + + z.SetType(n->GetType()); } else { if ( indirect && ! func_id->IsGlobal() ) { @@ -1263,9 +1267,6 @@ const ZAMStmt ZAMCompiler::DoCall(const CallExpr* c, const NameExpr* n) { z.aux->call_expr = {NewRef{}, const_cast(c)}; - if ( in_when ) - z.SetType(n->GetType()); - if ( ! indirect || func_id->IsGlobal() ) { z.aux->id_val = func_id;