llvm-project
8e965d89 - [analyzer] Fix zext assertion failure in loop unrolling (#121203)

Commit
1 year ago
[analyzer] Fix zext assertion failure in loop unrolling (#121203) The current implementation of APInt extension in the code can trigger an assertion failure when the `zext` function is called with a target width smaller than the current bit width. For example: ```cpp if (InitNum.getBitWidth() != BoundNum.getBitWidth()) { InitNum = InitNum.zext(BoundNum.getBitWidth()); BoundNum = BoundNum.zext(InitNum.getBitWidth()); } ``` This logic does not guarantee that the `zext` target width is always greater than or equal to the current bit width, leading to potential crashes. Expected Behavior: - Ensure InitNum and BoundNum are extended to the maximum of their respective widths. - Prevent assertion failures by enforcing correct `zext` usage. Fixes #121201
Parents
Loading