Skip to content

Conversation

@uzairnawaz
Copy link

Resolves line information issues described by #11203

For functions that don't include explicit return statements in the Go source code, the ssa package inserts return instructions without line information attached, leading to poor error messages.
Ex: -: return with unexpected locks held (locks: &({param:f}.mu) exclusively)

Quick fix is to instead use the line number information of the parent function instead.

@ayushr2
Copy link
Collaborator

ayushr2 commented Dec 9, 2025

Can you squash your commits, we don't have the ability to squash and merge yet.

@uzairnawaz uzairnawaz force-pushed the return-parent-line-numbers branch from 6e7b714 to dc3d29a Compare December 9, 2025 17:47
@uzairnawaz uzairnawaz force-pushed the return-parent-line-numbers branch from dc3d29a to 9a04865 Compare December 9, 2025 17:49
copybara-service bot pushed a commit that referenced this pull request Dec 9, 2025
…struction has no line numbers attached

Resolves line information issues described by #11203

For functions that don't include explicit return statements in the Go source code, the ssa package inserts return instructions without line information attached, leading to poor error messages.
Ex: -: return with unexpected locks held (locks: &({param:f}.mu) exclusively)

Quick fix is to instead use the line number information of the parent function instead.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12347 from uzairnawaz:return-parent-line-numbers 9a04865
PiperOrigin-RevId: 842286019
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