Skip to content

Commit

Permalink
Merge pull request #6535 from ibuclaw/nullchecks
Browse files Browse the repository at this point in the history
ThisExp.var is always a VarDeclaration in checkEscape.
  • Loading branch information
yebblies committed May 6, 2017
2 parents e29443f + 4b75387 commit 6c72a7b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/ddmd/escape.d
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,8 @@ private void escapeByValue(Expression e, EscapeByResults* er)

override void visit(ThisExp e)
{
VarDeclaration v = e.var.isVarDeclaration();
if (v)
er.byvalue.push(v);
if (e.var)
er.byvalue.push(e.var);
}

override void visit(DotVarExp e)
Expand Down Expand Up @@ -981,9 +980,8 @@ private void escapeByRef(Expression e, EscapeByResults* er)

override void visit(ThisExp e)
{
auto v = e.var.isVarDeclaration();
if (v)
er.byref.push(v);
if (e.var)
er.byref.push(e.var);
}

override void visit(PtrExp e)
Expand Down

0 comments on commit 6c72a7b

Please sign in to comment.