Skip to content

Commit

Permalink
dereferencing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubmisek committed Dec 30, 2018
1 parent 27ca30f commit d9ab438
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Peachpie.CodeAnalysis/FlowAnalysis/ExpressionAnalysis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ protected virtual void VisitLocalVariableRef(BoundVariableRef x, VariableHandle
{
// in global code, treat the variable as initialized always:
State.SetVarInitialized(local);
vartype.IsRef = true; // variable might be a reference
}
}

Expand Down Expand Up @@ -460,7 +461,7 @@ public override T VisitVariableRef(BoundVariableRef x)
if (x.Access.IsRead)
{
State.FlowContext.SetAllUsed();
x.TypeRefMask = TypeRefMask.AnyType;
x.TypeRefMask = TypeRefMask.AnyType.WithRefFlag;
}

if (x.Access.IsWrite || x.Access.IsEnsure)
Expand Down

0 comments on commit d9ab438

Please sign in to comment.