Any self modifying code needs to tell valgrind which piece of code has been modified. The attached patch makes writejump() in scheduler/sysdeps.c do this. Currently the code works OK under valgrind, since it is only used for trapping the __errno_location functions, which haven't yet been called (so they have not been JITted). Seeya, Adam -- Real Programmers don't comment their code. If it was hard to write, it should be hard to read, and even harder to modify. These are all my own opinions.
Attachment:
wine-selfmodify.pat
Description: Binary data