Skip to content

Commit

Permalink
6077 CTFE: Cannot append null array to null array
Browse files Browse the repository at this point in the history
Trivial - this case was missing from constant-folding.
  • Loading branch information
Don Clugston committed May 30, 2011
1 parent 26b2d82 commit 750b030
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/constfold.c
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,14 @@ Expression *Cat(Type *type, Expression *e1, Expression *e2)
e->type = type;
return e;
}
else if (e1->op == TOKnull && e2->op == TOKnull)
{
if (type == e1->type)
return e1;
if (type == e2->type)
return e2;
return new NullExp(e1->loc, type);
}
else if (e1->op == TOKstring && e2->op == TOKstring)
{
// Concatenate the strings
Expand Down

0 comments on commit 750b030

Please sign in to comment.