From cee3af7cc487334d477ff28c8b45521c221f0045 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Fri, 22 Jul 2022 16:43:40 +0300 Subject: [PATCH] Fix opAdd concatenating string and pointer Closes #78 --- src/interpreter.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/interpreter.cc b/src/interpreter.cc index 286009b9..104d0e27 100644 --- a/src/interpreter.cc +++ b/src/interpreter.cc @@ -1371,6 +1371,10 @@ static void opAdd(Program* program) strings[0] = (char*)internal_malloc_safe(80, __FILE__, __LINE__); // "..\\int\\INTRPRET.C", 1007 sprintf(strings[0], "%d", value[0].integerValue); break; + case VALUE_TYPE_PTR: + strings[0] = (char*)internal_malloc_safe(80, __FILE__, __LINE__); + sprintf(strings[0], "%p", value[0].pointerValue); + break; } tempString = (char*)internal_malloc_safe(strlen(strings[1]) + strlen(strings[0]) + 1, __FILE__, __LINE__); // "..\\int\\INTRPRET.C", 1015