On a 64 bit machines, uint32_t is promoted to unsigned int when compared with 0 and cannot ever be negative. cast it to int32_t first to force sign extension when comparing with 0.
This commit is contained in:
@@ -67,7 +67,7 @@ static int LoadInt(LoadState* S)
|
||||
LoadVar(S,x);
|
||||
if (S->flip)
|
||||
x = Swap32(x);
|
||||
IF (x<0, "bad integer");
|
||||
IF ((int32_t)x<0, "bad integer");
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user