Fix opAdd concatenating string and pointer

Closes #78
This commit is contained in:
Alexander Batalov 2022-07-22 16:43:40 +03:00
parent 8ab7f8493a
commit cee3af7cc4
1 changed files with 4 additions and 0 deletions

View File

@ -1371,6 +1371,10 @@ static void opAdd(Program* program)
strings[0] = (char*)internal_malloc_safe(80, __FILE__, __LINE__); // "..\\int\\INTRPRET.C", 1007 strings[0] = (char*)internal_malloc_safe(80, __FILE__, __LINE__); // "..\\int\\INTRPRET.C", 1007
sprintf(strings[0], "%d", value[0].integerValue); sprintf(strings[0], "%d", value[0].integerValue);
break; 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 tempString = (char*)internal_malloc_safe(strlen(strings[1]) + strlen(strings[0]) + 1, __FILE__, __LINE__); // "..\\int\\INTRPRET.C", 1015