Here's a patch for STLport 5.1 tree to fix the bug in _STLP_DEBUG mode. This comes from a compiler bug in the ARM compiler that is described here:
Essentially the compiler generates wrong code when structs are passed by value and the copy ctor isn't called, but the struct data words are passed by registers (and if the struct is larger, the remaining words are passed on the stack). When iterators are passed by value in _STLP_DEBUG mode, a list with valid iterators of the container is managed, and the wrong (local variable) pointer is inserted in this list.
The patch is a bit ugly with the ifdefs, but it fixes all problems in _STLP_DEBUG mode. Unit tests were run to verify this.
Log in to post a comment.