search for: ifsinstrarray

Displaying 2 results from an estimated 2 matches for "ifsinstrarray".

2013 Jan 08
1
[LLVMdev] LLVM seg fault : dereference an uninitialized pointer Instruction*
Hello everyone, I encounter a segfault problem in my LLVM function pass. I think the problem is that I dereference an uninitialized pointer from an array of Instruction* elements which results in undefined behavior. The array is : Instruction** ifsInstrArray = new Instruction*[100]; The problem appears only sometimes (during runOnFunction && visiting BasicBlocks and Instructions). Sometimes means, for e.g. : errs()<<*ifsInstrArray[0]<<"\n"<<*ifsInstrArray[1]; only for *ifsInstrArray[1] the segfault appears. I alre...
2012 Dec 21
0
[LLVMdev] llvm segfault Instruction::getOpcode
...rnDC : public FunctionPass` " but I also have class ifChecker { public: virtual bool operEquiv(Instruction *I1, Instruction *I2); }; I have in bool patternDC::runOnFunction(Function &F) { ... ifChecker* CC=new ifChecker(); if ( CC->operEquiv(ifsInstrArray[i], ifsInstrArray[j]) ) ... and bool ifChecker::operEquiv(Instruction *I1, Instruction *I2){ if (I1!=NULL && I2!=NULL) //if (I1->getOpcode() != I2->getOpcode()) return false; return true; } When I decomment the line from operEquiv, I have the...