aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/ragel6/patches/fix-ubsan.patch
blob: 86d40878d1043fa4774a56c7f60fa6fc9840dc87 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
--- a/parsedata.cpp
+++ b/parsedata.cpp
@@ -115,7 +115,7 @@ Key makeFsmKeyHex( char *str, const InputLoc &loc, ParseData *pd )
 	}
 
 	if ( unusedBits && keyOps->alphType->isSigned && ul >> (size * 8 - 1) )
-		ul |= ( -1L >> (size*8) ) << (size*8);
+		ul |= ( (unsigned long)(-1L) >> (size*8) ) << (size*8);
 
 	return Key( (long)ul );
 }