Fix leaf lineno #4
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ruby's backtrace code gets the line number directly from the cfp->iseq reference:
https://github.com/ruby/ruby/blob/52a17bbe6d778d56cc600f73f107c1992350f877/vm_backtrace.c#L1763-L1767
This updates the logic to do the same, rather than use the same iseq we are getting the labels from (the "CME" iseq).
In order to do this though, we need BOTH the CME iseq (for labels), and the "plain" iseq from cfp->iseq (for the line number). Most of the code here pertains to ferrying an additional address through to userspace by putting it into the 6 bytes of padding on the Frame struct, which is probably more controversial than anything else.