From 7cc91cc7554d506a82a3333e66c11ae102849095 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 26 Feb 2016 13:15:08 +0100 Subject: [PATCH] Don't use "p" and "p++" in the same statement in wxOSX OpenGL code This results in unspecified behaviour. See #16909. --- src/osx/cocoa/glcanvas.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osx/cocoa/glcanvas.mm b/src/osx/cocoa/glcanvas.mm index 1490dbaff8..7afbc6c39e 100644 --- a/src/osx/cocoa/glcanvas.mm +++ b/src/osx/cocoa/glcanvas.mm @@ -90,7 +90,10 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs, { n1--; // skip the ending '0' while ( p < n1 ) - data[p++] = (NSOpenGLPixelFormatAttribute) GLAttrs[p]; + { + data[p] = (NSOpenGLPixelFormatAttribute) GLAttrs[p]; + p++; + } } if ( ctxAttrs && n2 > 1 )