Skip to content

Commit

Permalink
Fix pointer comparison
Browse files Browse the repository at this point in the history
See #82
  • Loading branch information
alexbatalov committed Jul 23, 2022
1 parent cee3af7 commit f3869e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interpreter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -909,10 +909,10 @@ static void opConditionalOperatorNotEqual(Program* program)
case VALUE_TYPE_PTR:
switch (value[0].opcode) {
case VALUE_TYPE_INT:
result = (intptr_t)(value[1].pointerValue) == (intptr_t)(value[0].integerValue);
result = (intptr_t)(value[1].pointerValue) != (intptr_t)(value[0].integerValue);
break;
case VALUE_TYPE_PTR:
result = value[1].pointerValue == value[0].pointerValue;
result = value[1].pointerValue != value[0].pointerValue;
break;
default:
assert(false && "Should be unreachable");
Expand Down

0 comments on commit f3869e0

Please sign in to comment.