This is an archive of the discontinued LLVM Phabricator instance.

Fix ASAN error caused by commit r364512
ClosedPublic

Authored by rdhindsa on Jun 27 2019, 4:17 PM.

Details

Summary

This patch intends to fix ASAN stack-use-after-scope error. This error was introduced with commit r364512.

Diff Detail

Repository
rL LLVM

Event Timeline

rdhindsa created this revision.Jun 27 2019, 4:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2019, 4:17 PM
dblaikie accepted this revision.Jun 27 2019, 4:28 PM
dblaikie added a subscriber: rovka.

Looks good to me, please commit

(@rovka - this is at least a short-term fix, I'm approving this to unbreak LLVM's mainline - feel free to refix with other ideas if you have any (also happy to discuss this further with you here, IRC, or elsewhere on the mailing lists)

This revision is now accepted and ready to land.Jun 27 2019, 4:28 PM
This revision was automatically updated to reflect the committed changes.
rovka added a comment.Jun 28 2019, 3:06 AM

Looks good to me, please commit

(@rovka - this is at least a short-term fix, I'm approving this to unbreak LLVM's mainline - feel free to refix with other ideas if you have any (also happy to discuss this further with you here, IRC, or elsewhere on the mailing lists)

Thanks for looking into it and sorry about the breakage. I think one InVReg is sufficient, there's no need for a whole SmallVector there. What do you think about something like this?

Looks good to me, please commit

(@rovka - this is at least a short-term fix, I'm approving this to unbreak LLVM's mainline - feel free to refix with other ideas if you have any (also happy to discuss this further with you here, IRC, or elsewhere on the mailing lists)

Thanks for looking into it and sorry about the breakage. I think one InVReg is sufficient, there's no need for a whole SmallVector there. What do you think about something like this?

Looks good to me - if possible, it'd be nice to have an assert that when assigning to the SwiftInVReg variable, it hasn't been assigned to before (just to demonstrate that invariant - that only one arg would ever be the error arg), but no worries if that's not practical (if there's no clear null state for a Register, etc)

@rovka : There is one more instance of similar code in function translateInvoke around line 1670. I think you will need to update that as well.

rovka added a comment.Jul 1 2019, 8:16 AM

Thanks, committed in r364778!