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

Merge pull request #189 from QB64Team/put-string-bug

Fixes `PUT` with variable-length strings in UDTs. Closes #133
This commit is contained in:
Fellippe Heitor 2021-09-11 23:00:25 -03:00 committed by GitHub
commit ee96ff7649
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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