Skip to content

Commit

Permalink
two more negations that should go after unsigned conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
spoonincode committed Aug 21, 2023
1 parent 614b005 commit f68377f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/wasm-jit/Source/WAST/ParseNumbers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ bool tryParseInt(ParseState& state,UnsignedInt& outUnsignedInt,I64 minSignedValu
{
case t_decimalInt:
isNegative = parseSign(nextChar);
u64 = parseDecimalUnsignedInt(nextChar,state,isNegative ? U64(-minSignedValue) : maxUnsignedValue,"int literal");
u64 = parseDecimalUnsignedInt(nextChar,state,isNegative ? -U64(minSignedValue) : maxUnsignedValue,"int literal");
break;
case t_hexInt:
isNegative = parseSign(nextChar);
Expand All @@ -239,7 +239,7 @@ bool tryParseInt(ParseState& state,UnsignedInt& outUnsignedInt,I64 minSignedValu
return false;
};

outUnsignedInt = isNegative ? UnsignedInt(-I64(u64)) : UnsignedInt(u64);
outUnsignedInt = isNegative ? -UnsignedInt(I64(u64)) : UnsignedInt(u64);

++state.nextToken;
WAVM_ASSERT_THROW(nextChar <= state.string + state.nextToken->begin);
Expand Down

0 comments on commit f68377f

Please sign in to comment.