Merge DMD r296: bugzilla 3617 CTFE: wrong code for if(x) where x is int...

bugzilla 3617 CTFE: wrong code for if(x) where x is int or smaller.
---
 dmd/expression.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
This commit is contained in:
Leandro Lucarella
2010-01-06 15:18:21 -03:00
parent 9eba8c9f32
commit 2cdf1f6679

View File

@@ -1512,7 +1512,8 @@ complex_t IntegerExp::toComplex()
int IntegerExp::isBool(int result)
{
return result ? value != 0 : value == 0;
int r = toInteger() != 0;
return result ? r : !r;
}
Expression *IntegerExp::semantic(Scope *sc)