Change shift expressions to unsigned types. Shifting signed values to

a result that is not representable has undefined behaviour.
This commit is contained in:
Thomas Köppe authored and Zack Middleton committed 2018-01-21 06:01:50 -06:00
1 parent 7e2aa2c627
commit ed1794fe17
6 files changed
+11 -8

No files matched your search

+1 -1
View File
@@ -103,7 +103,7 @@ static int isu8(uint32_t v)
static int NextConstant4(void)
{
return (code[pc] | (code[pc+1]<<8) | (code[pc+2]<<16) | (code[pc+3]<<24));
return ((unsigned int)code[pc] | ((unsigned int)code[pc+1]<<8) | ((unsigned int)code[pc+2]<<16) | ((unsigned int)code[pc+3]<<24));
}
static int Constant4( void ) {