OSDN Git Service

nouveau: prevent undefined behavior in nouveau_pushbuf_reloc with gcc-4.8
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>
Thu, 7 Nov 2013 12:30:19 +0000 (13:30 +0100)
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>
Thu, 7 Nov 2013 12:37:49 +0000 (13:37 +0100)
Reported-by: ronald645@gmail.com
Bisected-by (gcc): Andreas Radke <a.radke@arcor.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71116
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
nouveau/pushbuf.c

index 0fd0c47..4f77881 100644 (file)
@@ -739,7 +739,8 @@ void
 nouveau_pushbuf_reloc(struct nouveau_pushbuf *push, struct nouveau_bo *bo,
                      uint32_t data, uint32_t flags, uint32_t vor, uint32_t tor)
 {
-       *push->cur++ = pushbuf_krel(push, bo, data, flags, vor, tor);
+       *push->cur = pushbuf_krel(push, bo, data, flags, vor, tor);
+       push->cur++;
 }
 
 int