WinRT: Fix compiler crash (msvc2013 arm)
authorMaurice Kalinowski <maurice.kalinowski@digia.com>
Tue, 12 Aug 2014 12:55:11 +0000 (14:55 +0200)
committerMaurice Kalinowski <maurice.kalinowski@digia.com>
Wed, 13 Aug 2014 07:41:09 +0000 (09:41 +0200)
Visual Studio 2013 Update 3 ARM compiler has issues with the code path
trying to optimize it. Instead of disabling optimization in general,
use a pragma for the function. x86 compilation is fine though.

Change-Id: If099f7d1400cb78958d10c2fd35daef3bb75fc91
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
src/websockets/qwebsocketframe.cpp

index e48308f..8236498 100644 (file)
@@ -312,6 +312,13 @@ bool QWebSocketFrame::isValid() const
     return m_isValid;
 }
 
+// The arm compiler of Visual Studio 2013 Update 3 crashes when
+// trying to optimize QWebSocketFrame::readFrame. Hence turn
+// those off for this snippet
+#if defined(Q_OS_WINPHONE) && defined(__ARM__)
+#  pragma optimize("", off)
+#endif
+
 #define WAIT_FOR_MORE_DATA(dataSizeInBytes)  \
     { returnState = processingState; \
       processingState = PS_WAIT_FOR_MORE_DATA; dataWaitSize = dataSizeInBytes; }
@@ -520,6 +527,10 @@ QWebSocketFrame QWebSocketFrame::readFrame(QIODevice *pIoDevice)
     return frame;
 }
 
+#if defined(Q_OS_WINPHONE) && defined(__ARM__)
+#  pragma optimize("", on)
+#endif
+
 /*!
     \internal
  */