Page MenuHomePhabricator

[DebugInfo] Avoid crash from dropped fragments in LiveDebugValues

Authored by jmorse on Aug 15 2019, 3:07 AM.



This patch is spun out of D65368, and purely aims to avoid a crash caused by DW_OP_LLVM_fragments being dropped from DIExpressions by LiveDebugValues spill-restore code. There are two hunks:

  • On spill restore, use fragment information from the spilt-location-expression, avoiding a later assertion failure
  • When spilling, don't spill any DBG_VALUE with a complex expression, as it can't be safely restored and will definitely lead to an incorrect variable location

The additional function in live-debug-values-restore.mir triggers an assertion failure on a unpatched x86_64 Debug build of LLVM, on Ubuntu 18. This crash will be in LLVM-9 too, so the intention is to cherry pick it there.

Diff Detail


Event Timeline

jmorse created this revision.Aug 15 2019, 3:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2019, 3:07 AM
aprantl accepted this revision.Aug 15 2019, 9:41 AM

This is patch 1. LGTM.

This revision is now accepted and ready to land.Aug 15 2019, 9:41 AM
This revision was automatically updated to reflect the committed changes.