[PATCH] D120610: [DebugInfo] Include DW_TAG_skeleton_unit when looking for parent UnitDie

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 17:54:13 PST 2022


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



More information about the llvm-commits mailing list