[all-commits] [llvm/llvm-project] 14b62f: [DebugInfo] CGP+HWasan: Handle dbg.values with dup...

Stephen Tozer via All-commits all-commits at lists.llvm.org
Mon Jul 5 02:35:59 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 14b62f7e2f07db548779fc17550a5265ef374413
      https://github.com/llvm/llvm-project/commit/14b62f7e2f07db548779fc17550a5265ef374413
  Author: Stephen Tozer <Stephen.Tozer at Sony.com>
  Date:   2021-07-05 (Mon, 05 Jul 2021)

  Changed paths:
    M llvm/lib/CodeGen/CodeGenPrepare.cpp
    M llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
    M llvm/test/DebugInfo/X86/codegenprep-addrsink.ll
    M llvm/test/Instrumentation/HWAddressSanitizer/alloca.ll

  Log Message:
  -----------
  [DebugInfo] CGP+HWasan: Handle dbg.values with duplicate location ops

This patch fixes an issue which occurred in CodeGenPrepare and
HWAddressSanitizer, which both at some point create a map of Old->New
instructions and update dbg.value uses of these. They did this by
iterating over the dbg.value's location operands, and if an instance of
the old instruction was found, replaceVariableLocationOp would be
called on that dbg.value. This would cause an error if the same operand
appeared multiple times as a location operand, as the first call to
replaceVariableLocationOp would update all uses of the old instruction,
invalidating the old iterator and eventually hitting an assertion.

This has been fixed by no longer iterating over the dbg.value's location
operands directly, but by first collecting them into a set and then
iterating over that, ensuring that we never attempt to replace a
duplicated operand multiple times.

Differential Revision: https://reviews.llvm.org/D105129




More information about the All-commits mailing list