Skip to content

Commit

Permalink
Fix opAdd concatenating string and pointer
Browse files Browse the repository at this point in the history
Closes #78
  • Loading branch information
alexbatalov committed Jul 22, 2022
1 parent 8ab7f84 commit cee3af7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/interpreter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cee3af7

Please sign in to comment.