Ticket #6187: Avoid infinite loop if eraseDeadCode does not remove anything (this time without memory corruption).
Merge pull request #456 from simartin/ticket_6817_take2

Ticket #6187: Avoid infinite loop if eraseDeadCode does not remove anything (this time without memory corruption).