mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-19 21:23:22 +01:00
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(-)
This commit is contained in:
@@ -669,14 +669,14 @@ Expression *EqualExp::optimize(int result)
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user