Commit bdddaeb
[checklocks] Use function line info for error messages when return instruction 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: 8422860191 parent 561ff6d commit bdddaeb
1 file changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
734 | 742 | | |
735 | 743 | | |
736 | 744 | | |
737 | 745 | | |
738 | 746 | | |
739 | | - | |
| 747 | + | |
740 | 748 | | |
741 | 749 | | |
742 | 750 | | |
743 | 751 | | |
744 | | - | |
| 752 | + | |
745 | 753 | | |
746 | 754 | | |
747 | 755 | | |
| |||
751 | 759 | | |
752 | 760 | | |
753 | 761 | | |
754 | | - | |
| 762 | + | |
755 | 763 | | |
756 | 764 | | |
757 | 765 | | |
| |||
0 commit comments