This is an archive of the discontinued LLVM Phabricator instance.

Fix the unwinding plan augmentation from x86 assembly
ClosedPublic

Authored by jarin on Oct 4 2019, 3:44 AM.

Details

Summary

Unwind plan augmentation should compute the plan row at offset x from the instruction before offset x, but currently we compute it from the instruction at offset x. Note that this behavior is a regression introduced when moving the x86 assembly inspection engine to its own file (https://github.com/llvm/llvm-project/commit/1c9858b298d79ce82c45a2954096718b39550109#diff-375a2be066db6f34bb9a71442c9b71fcL913); the original version handled this properly by copying the previous instruction out before advancing the instruction pointer.

The relevant bug with more info is here: https://bugs.llvm.org/show_bug.cgi?id=43561

Diff Detail

Event Timeline

jarin created this revision.Oct 4 2019, 3:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2019, 3:44 AM
jarin edited the summary of this revision. (Show Details)Oct 4 2019, 5:11 AM
jarin added a reviewer: labath.Oct 9 2019, 2:30 AM

Pavel, could you possibly take a look? It looks like Jason is busy with something else...

jasonmolenda accepted this revision.Oct 9 2019, 2:56 PM

Hi Jaroslav, I apologize for taking so long to look at this; I've been heads-down on a project the past few weeks an my email inbox is a disaster right now.

This patch looks good, thanks for doing this. The fragile thing is that we have two methods doing very similar things -- GetNonCallSiteUnwindPlanFromAssembly() and AugmentUnwindPlanFromCallSite() -- and we've got some divergence between the two that make it harder to spot bugs like this. I can't remember the history well, but I have a feeling that AugmentUnwindPlanFromCallSite() is basically an older version of how GetNonCallSiteUnwindPlanFromAssembly() was written.

This revision is now accepted and ready to land.Oct 9 2019, 2:56 PM
jarin added a comment.Oct 10 2019, 1:28 AM

Thank you for the review! Could you also possibly commit the change for me?

labath closed this revision.Oct 10 2019, 6:22 AM

I can do *that*: r374342