From d1a30f68fd3e369aed7bbdb5d9173b019f38f6ae Mon Sep 17 00:00:00 2001 From: nillerusr Date: Sat, 17 Dec 2022 10:14:49 +0300 Subject: [PATCH] windows: fix(workaround) illegal instruction in release build --- .github/workflows/build.yml | 2 +- engine/tmessage.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c51b0f8d61..779ebc77a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Build windows-i386 + - name: Build windows-amd64 run: | git submodule init && git submodule update ./waf.bat configure -T debug -8 diff --git a/engine/tmessage.cpp b/engine/tmessage.cpp index 72c65f22fe..c5e0011651 100644 --- a/engine/tmessage.cpp +++ b/engine/tmessage.cpp @@ -322,10 +322,17 @@ int ParseDirective( const char *pText ) { if ( ParseFloats( pText, tempFloat, 4 ) ) { - for ( int i = 0; i < 4; ++i ) + // that's original code, msvc2015 generates illegal instruction on amd64 architecture + /*for ( int i = 0; i < 4; ++i ) { gMessageParms.boxcolor[ i ] = (byte)(int)tempFloat[ i ]; - } + }*/ + + // workaround + gMessageParms.boxcolor[0] = (int)tempFloat[0]; + gMessageParms.boxcolor[1] = (int)tempFloat[1]; + gMessageParms.boxcolor[2] = (int)tempFloat[2]; + gMessageParms.boxcolor[3] = (int)tempFloat[3]; } } else if ( IsToken( pText, "clearmessage" ) )