Skip to content

Commit

Permalink
Swipe checks in divisions
Browse files Browse the repository at this point in the history
  • Loading branch information
mbovel committed Oct 20, 2020
1 parent e8a3779 commit d3b0b69
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,7 @@ public int execute(WasmContext context, VirtualFrame frame) {
int x = popInt(frame, stackPointer);
stackPointer--;
int y = popInt(frame, stackPointer);
if (y == Integer.MIN_VALUE && x == -1) {
if (x == -1 && y == Integer.MIN_VALUE) {
throw WasmException.create(Failure.INT_OVERFLOW, this);
}
int result = y / x;
Expand Down Expand Up @@ -1839,7 +1839,7 @@ public int execute(WasmContext context, VirtualFrame frame) {
long x = pop(frame, stackPointer);
stackPointer--;
long y = pop(frame, stackPointer);
if (y == Long.MIN_VALUE && x == -1) {
if (x == -1 && y == Long.MIN_VALUE) {
throw WasmException.create(Failure.INT_OVERFLOW, this);
}
final long result = y / x;
Expand Down

0 comments on commit d3b0b69

Please sign in to comment.