ReplaceInstWithInst appears to invalidate BB iterator?

Thanks Duncan. I was able to correct my code to work around that nuance. I was under the impression that BasicBlock::iterators mapped onto something similar to an STL list which supports erasing arbitrary elements. Thanks for the help!

-Justin

Hi Justin,

Thanks Duncan. I was able to correct my code to work around that nuance. I was
under the impression that BasicBlock::iterators mapped onto something similar to
an STL list which supports erasing arbitrary elements. Thanks for the help!

instructions contain pointers to the next and previous instructions; an
iterator is just a pointer to an instruction that advances by looking at
the value of the instructions "next" pointer. IIRC.

Ciao, Duncan.