Skip to content

Commit ff2211f

Browse files
committed
windows: fix(workaround) illegal instruction in release build
1 parent af8c358 commit ff2211f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
steps:
4848
- uses: actions/checkout@v2
49-
- name: Build windows-i386
49+
- name: Build windows-amd64
5050
run: |
5151
git submodule init && git submodule update
5252
./waf.bat configure -T debug -8

engine/tmessage.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,17 @@ int ParseDirective( const char *pText )
322322
{
323323
if ( ParseFloats( pText, tempFloat, 4 ) )
324324
{
325-
for ( int i = 0; i < 4; ++i )
325+
// that's original code, msvc2015 generates illegal instruction on amd64 architecture
326+
/*for ( int i = 0; i < 4; ++i )
326327
{
327328
gMessageParms.boxcolor[ i ] = (byte)(int)tempFloat[ i ];
328-
}
329+
}*/
330+
331+
// workaround
332+
gMessageParms.boxcolor[0] = (int)tempFloat[0];
333+
gMessageParms.boxcolor[1] = (int)tempFloat[1];
334+
gMessageParms.boxcolor[2] = (int)tempFloat[2];
335+
gMessageParms.boxcolor[3] = (int)tempFloat[3];
329336
}
330337
}
331338
else if ( IsToken( pText, "clearmessage" ) )

0 commit comments

Comments
 (0)