Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable length strings in deeply nested UDTs are not initialised #524

Closed
flukiluke opened this issue Jul 27, 2024 · 0 comments · Fixed by #527
Closed

Variable length strings in deeply nested UDTs are not initialised #524

flukiluke opened this issue Jul 27, 2024 · 0 comments · Fixed by #527
Assignees
Labels
bug Something isn't working

Comments

@flukiluke
Copy link
Contributor

The following program crashes with a segmentation fault on the last line:

Type t1
    a As String
End Type

Type t2
    b As t1
    s As String
End Type

Type t3
    n As Long
    c As t2
End Type

Dim test As t3

Print test.c.s 'OK
Print test.c.b.a 'Segmentation fault

Initially observed at https://qb64phoenix.com/forum/showthread.php?tid=2889

Reproduced on Linux, commit 35d901f. At a glance the bad pointer looks to be the high 4 bytes of a valid pointer shifted down, so I suspect a misaligned store in the initialisation.

@flukiluke flukiluke added the bug Something isn't working label Jul 27, 2024
@flukiluke flukiluke self-assigned this Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant