[PATCH] D38924: Fix `FaultMaps` crash when the out streamer is reused

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 14 17:15:28 PDT 2017


sanjoy accepted this revision.
sanjoy added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/Target/X86/X86AsmPrinter.h:137
     SMShadowTracker.reset(0);
     SM.reset();
+    FM.reset();
----------------
yuyichao wrote:
> 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.
Ok, that sgtm; but I want @skatkov to take a look.


https://reviews.llvm.org/D38924





More information about the llvm-commits mailing list