[PATCH] D46738: [DebugInfo] Fix PR37395.

Hsiangkai Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 20 19:01:07 PDT 2018


HsiangKai added a comment.

In https://reviews.llvm.org/D46738#1098068, @aprantl wrote:

> Neither the PR nor this review contain any information on why removing the assertion is the correct action here. Can you explain why this is the right fix, and what the MDNode is when the assertion fires?


getVariableLocation() assumes all DbgInfoIntrinsic has the address value as its first operand. It is not the case for DILabel.

When the assertion is triggered, MDNode is DILabel. The first operand of DILabel is a metadata to keep label information, not address value. So, the second if contition, dyn_cast<ValueAsMetadata>, will return null.

It adds an assertion to ensure the number of operand must be zero before returning nullptr. I am not sure it is reasonable to check the condition before return. Is there any case it must ensure the number of operands be zero before returning nullptr?


Repository:
  rL LLVM

https://reviews.llvm.org/D46738





More information about the llvm-commits mailing list