Segmentation fault on Instruction.moveBefore()

Hi,
I’m getting a segmentation fault trying to write a small(incomplete) LICM pass whenever i try to do

I->moveBefore(pre->getTerminator());
(wherer I is Instruction*, Pre is BasicBlock*)

Is there any prerequisites for executing this function that i am not doing?

Thanks in advance.
sreeraj

The Problem is solved.
It was already discussed , i didnt bother to check the list first.

Sorry to spam your inboxes.
thanks