[PATCH] D92634: [Analyzer] Diagnose signed integer overflow

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 15 02:31:45 PST 2020


martong added a comment.

In D92634#2453822 <https://reviews.llvm.org/D92634#2453822>, @OikawaKirie wrote:

> I think it could be better to implement this check with a checker on `PreStmt<BinaryOperator>` and so on. And IMO, checkers have enough functionalities to report these problems.
>
> Besides, the return value should be the exact value computed from the two integers, even unknown, rather than undefined. As the developers may overflow an integer on purpose.

+1
To provide warnings on overflows is a great idea. However, perhaps a separate new checker should emit a report with more information (i.e. that an overflow could happen vs "undefined").


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92634/new/

https://reviews.llvm.org/D92634



More information about the cfe-commits mailing list