# HG changeset patch # User Leandro Lucarella # Date 1262801902 10800 # Node ID a542ef277a84007b7057e7721a7196ead0f7bee1 # Parent fb2e6707ad1769c908547df6f897cddd016796d7 Merge DMD r316: bugzilla 3628 can't cast null to int --- dmd/constfold.c | 2 +- dmd/optimize.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff -r fb2e6707ad17 -r a542ef277a84 dmd/optimize.c --- a/dmd/optimize.c Wed Jan 06 15:18:22 2010 -0300 +++ b/dmd/optimize.c Wed Jan 06 15:18:22 2010 -0300 @@ -669,14 +669,14 @@ } Expression *IdentityExp::optimize(int result) -{ Expression *e; - +{ //printf("IdentityExp::optimize(result = %d) %s\n", result, toChars()); e1 = e1->optimize(WANTvalue | (result & WANTinterpret)); e2 = e2->optimize(WANTvalue | (result & WANTinterpret)); - e = this; + Expression *e = this; - if (this->e1->isConst() && this->e2->isConst()) + if ((this->e1->isConst() && this->e2->isConst()) || + (this->e1->op == TOKnull && this->e2->op == TOKnull)) { e = Identity(op, type, this->e1, this->e2); if (e == EXP_CANT_INTERPRET)