[llvm-dev] Value* from ValueAsMetadata::getValue() gone

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Fri Jan 27 08:10:09 PST 2017


Could you provide full reproduction steps, if possible? (ie: reproducible
with existing LLVM source, or if necessary, a small patch - then exactly
what command line to run under GDB, where to break, step, print, etc)

On Thu, Jan 26, 2017 at 11:47 AM Welson Sun via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> So this is the two lines of code:
>
>         ValueAsMetadata *v =
> static_cast<ValueAsMetadata*>(metadata->getOperand(i)->getOperand(0).get());
>         Value *val = v->getValue();
>
> After executing these two lines, in gdb:
> (gdb) print val
> $1 = (llvm::Value *) 0x0
> (gdb) print v->getValue()
> $2 = (llvm::Value *) 0x4346d68
>
> How could this happen?
>
> --
> - Welson
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170127/e1fbe15b/attachment.html>


More information about the llvm-dev mailing list