Skip to content

Commit

Permalink
Merge pull request #1847 from 9rnsr/fix9885
Browse files Browse the repository at this point in the history
Issue 9885 - IFTI should consider known tuple types
  • Loading branch information
WalterBright committed Apr 6, 2013
2 parents 03cf926 + 374ff5e commit 2b88974
Show file tree
Hide file tree
Showing 3 changed files with 245 additions and 138 deletions.
8 changes: 2 additions & 6 deletions src/optimize.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,8 @@ Expression *CallExp::optimize(int result, bool keepLvalue)
size_t pdim = Parameter::dim(tf->parameters) - (tf->varargs == 2 ? 1 : 0);
for (size_t i = 0; i < arguments->dim; i++)
{
bool keepLvalue = false;
if (i < pdim)
{
Parameter *p = Parameter::getNth(tf->parameters, i);
keepLvalue = ((p->storageClass & (STCref | STCout)) != 0);
}
Parameter *p = Parameter::getNth(tf->parameters, i);
bool keepLvalue = (p ? (p->storageClass & (STCref | STCout)) != 0 : false);
Expression *e = (*arguments)[i];
e = e->optimize(WANTvalue, keepLvalue);
(*arguments)[i] = e;
Expand Down

0 comments on commit 2b88974

Please sign in to comment.