1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-02 23:31:21 +00:00

Fixes PUT with variable-length strings in UDTs. Closes #133

This commit is contained in:
FellippeHeitor 2021-09-11 00:52:28 -03:00
parent 1a92e9b318
commit 296a46b33c

View file

@ -18028,6 +18028,11 @@ FUNCTION evaluatetotyp$ (a2$, targettyp AS LONG)
IF (udtetype(E) AND ISSTRING) > 0 AND (udtetype(E) AND ISFIXEDLENGTH) = 0 AND (targettyp = -5) THEN
evaluatetotyp$ = "(*(qbs**)" + dst$ + ")->len"
EXIT FUNCTION
ELSEIF (udtetype(E) AND ISSTRING) > 0 AND (udtetype(E) AND ISFIXEDLENGTH) = 0 AND (targettyp = -4) THEN
dst$ = "(*((qbs**)((char*)" + scope$ + n$ + "+(" + o$ + "))))->chr"
bytes$ = "(*((qbs**)((char*)" + scope$ + n$ + "+(" + o$ + "))))->len"
evaluatetotyp$ = "byte_element((uint64)" + dst$ + "," + bytes$ + "," + NewByteElement$ + ")"
EXIT FUNCTION
END IF
bytes$ = str2(udtesize(E) \ 8)
END IF