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

Fix segfault caused by UnusedLabelCheck #83

Merged

Conversation

Vladiwostok
Copy link
Collaborator

@Vladiwostok Vladiwostok commented Dec 13, 2023

Asm support for long instruction arch has been added in phobos.
The visit function for AsmStatement in UnusedLabelCheck uses the instruction's token name (ident.toString()) in order to check for jump instruction. For some reason, the token's identifier gets initialized, however the identifier's name does not (its char* is null).

EDIT: The segfault was caused by using the token's identifier, which is part of a union. In some cases, the union member initialized is not the identifier.

@Vladiwostok Vladiwostok force-pushed the fix-unused-label-segf branch 2 times, most recently from 5dc990d to 97b081e Compare December 13, 2023 21:48
src/dscanner/analysis/unused_label.d Outdated Show resolved Hide resolved
src/dscanner/analysis/unused_label.d Outdated Show resolved Hide resolved
Copy link
Collaborator

@edi33416 edi33416 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RazvanN7 RazvanN7 merged commit c3c7ee1 into Dlang-UPB:replace_libdparse Dec 18, 2023
11 of 13 checks passed
@Vladiwostok Vladiwostok deleted the fix-unused-label-segf branch January 20, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants