<div dir="ltr">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)<br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 26, 2017 at 11:47 AM Welson Sun via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">So this is the two lines of code:<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg"> ValueAsMetadata *v = static_cast<ValueAsMetadata*>(metadata->getOperand(i)->getOperand(0).get());</div><div class="gmail_msg"> Value *val = v->getValue();</div><div class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">After executing these two lines, in gdb:</div><div class="gmail_msg"><div class="gmail_msg">(gdb) print <span style="background-color:rgb(255,255,0)" class="gmail_msg">val</span></div><div class="gmail_msg">$1 = (llvm::Value *) <span style="background-color:rgb(255,255,0)" class="gmail_msg">0x0</span></div><div class="gmail_msg">(gdb) print v->getValue()</div><div class="gmail_msg">$2 = (llvm::Value *) 0x4346d68</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">How could this happen?</div><div class="gmail_msg"><br class="gmail_msg"></div>-- <br class="gmail_msg"><div class="m_1275693441764836801gmail_signature gmail_msg"><div dir="ltr" class="gmail_msg">- Welson<br class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div></div>
</div></div>
_______________________________________________<br class="gmail_msg">
LLVM Developers mailing list<br class="gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
</blockquote></div>