diff --git a/src/Peachpie.CodeAnalysis/CodeGen/Graph/BoundExpression.cs b/src/Peachpie.CodeAnalysis/CodeGen/Graph/BoundExpression.cs index 2cc4544430..bb395f1a7e 100644 --- a/src/Peachpie.CodeAnalysis/CodeGen/Graph/BoundExpression.cs +++ b/src/Peachpie.CodeAnalysis/CodeGen/Graph/BoundExpression.cs @@ -3958,8 +3958,9 @@ internal override TypeSymbol Emit(CodeGenerator cg) { // store value of target // = TARGET - tempvar = cg.GetTemporaryLocal(target_load_type); cg.EmitOpCode(ILOpCode.Dup); + var tempvar_type = cg.EmitDereference(target_load_type); + tempvar = cg.GetTemporaryLocal(tempvar_type); cg.Builder.EmitLocalStore(tempvar); } @@ -3977,8 +3978,8 @@ internal override TypeSymbol Emit(CodeGenerator cg) { // store value of result // = TARGET - tempvar = cg.GetTemporaryLocal(op_type); cg.EmitOpCode(ILOpCode.Dup); + tempvar = cg.GetTemporaryLocal(op_type); cg.Builder.EmitLocalStore(tempvar); }