[all-commits] [llvm/llvm-project] f1eed0: MathExtras: add overflow query for signed-div (#97...
Ramkumar Ramachandra via All-commits
all-commits at lists.llvm.org
Tue Jul 9 01:34:08 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f1eed011b4b28aecd07170f9b26cc0efb45904ee
https://github.com/llvm/llvm-project/commit/f1eed011b4b28aecd07170f9b26cc0efb45904ee
Author: Ramkumar Ramachandra <ramkumar.ramachandra at codasip.com>
Date: 2024-07-09 (Tue, 09 Jul 2024)
Changed paths:
M llvm/include/llvm/ADT/DynamicAPInt.h
M llvm/include/llvm/Support/MathExtras.h
M llvm/unittests/Support/MathExtrasTest.cpp
M mlir/lib/IR/AffineExpr.cpp
Log Message:
-----------
MathExtras: add overflow query for signed-div (#97901)
5221634 (Do not trigger UB during AffineExpr parsing) noticed that
divideCeilSigned and divideFloorSigned would overflow when Numerator =
INT_MIN, and Denominator = -1. This observation has already been made by
DynamicAPInt, and it has code to check this. To avoid checks in multiple
callers, centralize this query in MathExtras, and change
divideCeilSigned/divideFloorSigned to assert on overflow.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list