Welson Sun via llvm-dev
2017-Jan-26 19:47 UTC
[llvm-dev] Value* from ValueAsMetadata::getValue() gone
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170126/9ad1aa0d/attachment.html>
David Blaikie via llvm-dev
2017-Jan-27 16:10 UTC
[llvm-dev] Value* from ValueAsMetadata::getValue() gone
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>