1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 13:50:36 +00:00

Prevent crash when using CLEAR with var-len string UDTs

Still doesn't fix it, but prevents the crash.
Variables won't be cleared with this temporary patch.
This commit is contained in:
FellippeHeitor 2021-09-26 21:06:44 -03:00
parent 64306e4e10
commit 5c9cc96ca7

View file

@ -11485,7 +11485,11 @@ FOR i = 1 TO idn
END IF
END IF
IF typ AND ISUDT THEN
PRINT #12, "memset((void*)" + e$ + ",0," + bytes$ + ");"
IF udtxvariable(typ AND 511) THEN
'this is where new code must come to clear UDTs with variable-length strings
ELSE
PRINT #12, "memset((void*)" + e$ + ",0," + bytes$ + ");"
END IF
ELSE
IF INSTR(vWatchVariableExclusions$, "@" + e$ + "@") = 0 AND LEFT$(e$, 12) <> "_SUB_VWATCH_" THEN
PRINT #12, "*" + e$ + "=0;"