This patch intends to fix ASAN stack-use-after-scope error. This error was introduced with commit r364512.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
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.