Mercurial > projects > ldc
changeset 1622:a542ef277a84
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(-)
author | Leandro Lucarella <llucax@gmail.com> |
---|---|
date | Wed, 06 Jan 2010 15:18:22 -0300 |
parents | fb2e6707ad17 |
children | 1d48eced441f |
files | dmd/optimize.c |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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)