Return 0 if we emulate x - x

This commit is contained in:
de4dot 2011-10-17 07:55:06 +02:00
parent fdd3c119f5
commit d34184f811
2 changed files with 4 additions and 0 deletions

View File

@ -196,6 +196,8 @@ namespace de4dot.blocks.cflow {
public static Int32Value Sub(Int32Value a, Int32Value b) {
if (a.allBitsValid() && b.allBitsValid())
return new Int32Value(a.value - b.value);
if (ReferenceEquals(a, b))
return new Int32Value(0);
return createUnknown();
}

View File

@ -111,6 +111,8 @@ namespace de4dot.blocks.cflow {
public static Int64Value Sub(Int64Value a, Int64Value b) {
if (a.allBitsValid() && b.allBitsValid())
return new Int64Value(a.value - b.value);
if (ReferenceEquals(a, b))
return new Int32Value(0);
return createUnknown();
}