From f3869e0acf14a4def0f347fe4670d6211ee07b25 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sat, 23 Jul 2022 07:25:39 +0300 Subject: [PATCH] Fix pointer comparison See #82 --- src/interpreter.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interpreter.cc b/src/interpreter.cc index 104d0e2..6f0048b 100644 --- a/src/interpreter.cc +++ b/src/interpreter.cc @@ -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");