mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 08:33:14 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user