I solved by checking <br><br>if(BB->size()>1)<br><br>Thank you all for the help ! <br><br>Now debugging the next segfault.<br><br><div class="gmail_quote">On Thu, Dec 20, 2012 at 12:59 PM, Alexandru Ionut Diaconescu <span dir="ltr"><<a href="mailto:alexandruionutdiaconescu@gmail.com" target="_blank">alexandruionutdiaconescu@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><table><tbody><tr><td valign="bottom"><a href="http://llvm.org/docs/doxygen/html/classllvm_1_1ilist__node.html#a77b897207ef0a1ae95c404695aed9a4b" target="_blank">getPrevNode</a> ()</td>
</tr>

<tr><td> </td><td>Get the previous node, or 0 for the list head.  </td></tr></tbody></table>I don't see any method like hasPrevNode. <br>It can be a weird problem because "current->getPrevNode()" is indicating to "current" itself (the problem appears for the BB with only one element)?<div class="HOEnZb">
<div class="h5"><br>
<br><br><br><br><div class="gmail_quote">On Thu, Dec 20, 2012 at 12:42 PM, Alexandru Ionut Diaconescu <span dir="ltr"><<a href="mailto:alexandruionutdiaconescu@gmail.com" target="_blank">alexandruionutdiaconescu@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br><br>Thank you for your answer. If I want to use<br><br>then I have<br><br>error: ‘NodeTy* llvm::ilist_half_node<NodeTy>::getPrev() [with NodeTy = llvm::Instruction]’ is protected<br>

error: ‘llvm::ilist_half_node<llvm::Instruction>’ is not an accessible base of ‘llvm::Instruction’<br>
<br>Do you know any other method to access the previous instruction of a terminator instruction? PS: back() is not an option.<br><br><div class="gmail_quote">On Thu, Dec 20, 2012 at 12:06 PM, Stephen McGruer <span dir="ltr"><<a href="mailto:stephen.mcgruer@gmail.com" target="_blank">stephen.mcgruer@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">current->getPrev()</blockquote></div><div><div><br><br clear="all"><br>-- <br><font style="color:rgb(153,153,153)">Best regards,</font><br style="color:rgb(153,153,153)">


<font style="color:rgb(153,153,153)">Alexandru Ionut Diaconescu</font><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><font style="color:rgb(153,153,153)">Best regards,</font><br style="color:rgb(153,153,153)">
<font style="color:rgb(153,153,153)">Alexandru Ionut Diaconescu</font><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><font style="background-color:rgb(255,255,255);color:rgb(153,153,153)">Best regards,</font><br style="background-color:rgb(255,255,255);color:rgb(153,153,153)">
<font style="background-color:rgb(255,255,255);color:rgb(153,153,153)">Alexandru Ionut Diaconescu</font><br>