Carlos Sánchez de La Lama
2011-Nov-14 11:32 UTC
[LLVMdev] ilist::getPrevNode asserts on list head
Hi all,
I am finding a SEGFAULT in one of my passes when using getPrevNode on an
instruction that is the only one in a BasicBlock. I was expecting
getPrevNode to return 0 in that case (as per docs), but it breaks.
I guess the code in in ilist_node.h:
NodeTy *getPrevNode() {
NodeTy *Prev = this->getPrev();
// Check for sentinel.
if (!Prev->getNext())
return 0;
return Prev;
}
would need to check if Prev is NULL before calling Prev->getNext().
BR
Carlos
Seemingly Similar Threads
- [LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
- [LLVMdev] Problem using ilist container
- [LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
- [LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
- [LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
