diff options
author | db <db@FreeBSD.org> | 2008-01-28 05:37:56 +0800 |
---|---|---|
committer | db <db@FreeBSD.org> | 2008-01-28 05:37:56 +0800 |
commit | 4563bf360deafb438257d76e619c40f1352bf116 (patch) | |
tree | 4d32ea1975ddd690af68631e9e11988bcbba6dd6 /devel | |
parent | 76ab267226ac34872b2bce6db8f151d999b06404 (diff) | |
download | freebsd-ports-gnome-4563bf360deafb438257d76e619c40f1352bf116.tar.gz freebsd-ports-gnome-4563bf360deafb438257d76e619c40f1352bf116.tar.zst freebsd-ports-gnome-4563bf360deafb438257d76e619c40f1352bf116.zip |
- The x86 inline assembler version of the SDL macro SDL_revcpy() sets the
direction flag ("std"), but does not clear it ("cld"). This is invalid
according to GCC (inline assembler, which sets the direction flag,
must reset it[0]) and the SYS V ABI (functions must leave with the
direction flag cleared[1]). The macro is (indirectly, exact call
sequence below) used in SDL_BlitSurface(), so this call sometimes
returns with the direction flag set. This happens for bliting a surface
onto itself with the destination coordinates set right/down of the source
coordinates (typical use of this is scrolling left/up). Later on other
parts of the code (like inlined memcpy()) cause memory corruption. [1]
- Give maintaintership to submitter (as discussed on irc)
PR: ports/120052 [1]
Diffstat (limited to 'devel')
-rw-r--r-- | devel/sdl12/files/patch-include_SDL_stdinc.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/devel/sdl12/files/patch-include_SDL_stdinc.h b/devel/sdl12/files/patch-include_SDL_stdinc.h new file mode 100644 index 000000000000..319d4a36a403 --- /dev/null +++ b/devel/sdl12/files/patch-include_SDL_stdinc.h @@ -0,0 +1,10 @@ +--- include/SDL_stdinc.h.orig 2006-06-27 00:48:32.000000000 -0400 ++++ include/SDL_stdinc.h 2008-01-27 12:47:15.000000000 -0500 +@@ -319,6 +319,7 @@ + __asm__ __volatile__ ( \ + "std\n\t" \ + "rep ; movsl\n\t" \ ++ "cld\n\t" \ + : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ + : "0" (n >> 2), \ + "1" (dstp+(n-4)), "2" (srcp+(n-4)) \ |