Skip to content

Commit

Permalink
fix post increment of aliased variable
Browse files Browse the repository at this point in the history
fixes #1086
  • Loading branch information
jakubmisek committed Jan 21, 2023
1 parent e548ba4 commit e07d768
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Peachpie.CodeAnalysis/CodeGen/Graph/BoundExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3958,8 +3958,9 @@ internal override TypeSymbol Emit(CodeGenerator cg)
{
// store value of target
// <temp> = 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);
}

Expand All @@ -3977,8 +3978,8 @@ internal override TypeSymbol Emit(CodeGenerator cg)
{
// store value of result
// <temp> = TARGET
tempvar = cg.GetTemporaryLocal(op_type);
cg.EmitOpCode(ILOpCode.Dup);
tempvar = cg.GetTemporaryLocal(op_type);
cg.Builder.EmitLocalStore(tempvar);
}

Expand Down

0 comments on commit e07d768

Please sign in to comment.