Fix toBoolean()

This commit is contained in:
de4dot 2012-01-21 20:04:13 +01:00
parent f65adc81d8
commit 3c85b3f964

View File

@ -86,7 +86,11 @@ namespace de4dot.blocks.cflow {
}
public Int32Value toBoolean() {
return new Int32Value(value & 1, validMask | (NO_UNKNOWN_BITS << 1));
if (isNonZero())
return new Int32Value(1, NO_UNKNOWN_BITS);
if (isZero())
return this;
return createUnknownBool();
}
public Int32Value toInt8() {