wenlei added a comment.

In D120610#3348997 <https://reviews.llvm.org/D120610#3348997>, @dblaikie wrote:

> This should include a test - and could you describe more about where this 
> issue came up/what motivated the change?

Sure, sorry for the delay as I just got back to this today. I sent the fix 
first hoping to get a sanity check as we were a bit puzzled how come nobody hit 
this in the past.

Here's what happened for the ICE - we needed to add template types when 
constructing subprogram die for template functions (`addTemplateParams`) for 
the skeleton CU, this is done through `getOrCreateContextDIE` which involves 
finding/creating parent DIEs. For that, we sometimes need to retrieve top level 
DIE (`getOrCreateContextDIE` -> `getUnitDie`). Before this fix, we end up with 
nullptr from `getUnitDie`, so some DIEs created in that process has `getUnit()` 
being null which leads to ICE on access.

I added a test case that would cause ICE without this fix (the set of flags 
there is minimum).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120610/new/

https://reviews.llvm.org/D120610

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to