In testlib/qsignalspy.h, there is the following code:
i is in this case the iterator of the for loop.
Since 0161f00e5043090f22b23de9822c09062b17d675 we generate the following code in moc:
This overwrites the loop iterator with 0 if sizeof(int) < sizeof(void*), and we enter an infinite loop.
I am assuming the code in QSignalSpy is wrong, but since it is the moc output that has changed and it causes memory corruption, I think it is better if someone who knows this code makes the call on what the right fix is.