[PATCH] D46738: [DebugInfo] Fix PR37395.

Hsiangkai Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 21 18:59:16 PDT 2018


HsiangKai added a comment.

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

> > 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?
>
> Why aren't you checking whether  `this` is a DILabel instead?


Although the fix is for DILabel now, I think it is a more general fix for DbgInfoIntrinsic without address as its first operand.


Repository:
  rL LLVM

https://reviews.llvm.org/D46738





More information about the llvm-commits mailing list