Skip to content

Conversation

@wrongtest-intellif
Copy link
Contributor

Hi there~ the change try fix an issue due to #12515.

Previously the logic for -2147483648 is parse(-literal) = -parse(literal), and all integer literals are converted to i32 (either the literal value actually overflow or not).

Since after #12515, parse 2147483648 results to an i64 typed integer rather than i32, -2147483648 then becomes to one i64 integer too, which is not reasonable.

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this corner case!

@junrushao junrushao merged commit 9a3b3dd into apache:main Sep 15, 2022
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
This change tries to fix an issue due to apache#12515.

Previously the logic for `-2147483648` is  `parse(-literal)` = `-parse(literal)`, and all integer literals are converted to i32 (either the literal value actually overflow or not).

Since after apache#12515, parse `2147483648` results in an i64 typed integer rather than i32, `-2147483648` then becomes an i64 integer too, which is not reasonable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants