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 crash when disabling debug info #4249

Merged

Conversation

dwblaikie
Copy link
Contributor

The source line debug info generation assumed that the function would have debug info. Check for a non-null di_subprogram_ to ensure we are emitting debug info for the function.

Rather than checking the di_builder_ - this way if we implement nodebug function attributes, it'll fall out naturally (by creating a null di_subprogram_) rather than having to come back and change this from "is debug info enabled" to "is debug info enabled for this function" later on.

The source line debug info generation assumed that the function would
have debug info. Check for a non-null di_subprogram_ to ensure we are
emitting debug info for the function.

Rather than checking the di_builder_ - this way if we implement
`nodebug` function attributes, it'll fall out naturally (by creating a
null di_subprogram_) rather than having to come back and change this
from "is debug info enabled" to "is debug info enabled for this
function" later on.
dwblaikie added a commit to dwblaikie/carbon-lang that referenced this pull request Aug 26, 2024
I think this is what you were looking for, @jonmeow? (I was trying to
figure out how to tersely phrase the check to be "this isn't supported
here yet, and not clear if it needs to be supported here - but if this
assert is hit, then we should add support here?" - open to wording
suggestions)

(this will fail testing due to carbon-language#4249 - so shouldn't be submitted before
that, though they aren't textually/patch-ually dependent on each other)
Copy link
Contributor

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

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

Good catch!

@jonmeow jonmeow added this pull request to the merge queue Aug 26, 2024
Merged via the queue into carbon-language:trunk with commit 5177ebb Aug 26, 2024
10 checks passed
@dwblaikie dwblaikie deleted the debug_info_source_locations_nodebug branch August 28, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants