[PATCH] D38924: Fix `FaultMaps` crash when the out streamer is reused
Yichao Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 14 16:57:07 PDT 2017
yuyichao added inline comments.
================
Comment at: lib/Target/X86/X86AsmPrinter.h:137
SMShadowTracker.reset(0);
SM.reset();
+ FM.reset();
----------------
sanjoy wrote:
> Does it make sense to do these things in `doFinalization`?
As I said, I'm mainly following `SM` here.
That said, I do think something needs to be done here. IIUC, these maps holds information about the module so it makes sense to initialize them when the pass is going to handle a new module. It might also be good to also reset them in `reset` so that (assuming `reset` is called at the same time the `MCContext` is reset) the map won't hold any invalid pointers. I didn't also do that because `SM` didn't and the invalid pointers themselves won't cause a crash as long as they are cleared before the run starts.
https://reviews.llvm.org/D38924
More information about the llvm-commits
mailing list