2 Commits

Author SHA1 Message Date
Karl-Johan Karlsson
d25e0aac41
[Sema] Fixed faulty shift count warning (#69521)
Constant values of _BitInt have the bitwith to exactly fit the constant
number. This patch fix a problem in Sema when building an APInt where
the supplied bitwidth can become too small and simply truncate the value
leading to a faulty warning.
2023-10-25 09:48:01 +02:00
Björn Pettersson
7d2b569cc4
[Sema] Handle large shift counts in GetExprRange (#68590)
GetExprRange did not expect that very large shift counts when
narrowing the range based on logical right shifts. So with inputs
such as
    *a >> 123456789012345678901uwb
it would hit assertions about trying to convert a too large APInt
into uint64_t.
This patch fixes that by using the APInt value when determining if
we should reduce the range by the shift count or not.
2023-10-10 10:25:01 +02:00