[all-commits] [llvm/llvm-project] 175ad6: [analyzer] Mention possibility of underflow in arr...

NagyDonat via All-commits all-commits at lists.llvm.org
Tue Mar 19 06:12:48 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 175ad6630a869831126dde80f0f9257f9c4c477f
      https://github.com/llvm/llvm-project/commit/175ad6630a869831126dde80f0f9257f9c4c477f
  Author: NagyDonat <donat.nagy at ericsson.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
    M clang/test/Analysis/out-of-bounds-diagnostics.c
    M clang/test/Analysis/taint-diagnostic-visitor.c

  Log Message:
  -----------
  [analyzer] Mention possibility of underflow in array overflow errors (#84201)

The checker alpha.security.ArrayBoundV2 performs bounds checking in two
steps: first it checks for underflow, and if it isn't guaranteed then it
assumes that there is no underflow. After this, it checks for overflow,
and if that's guaranteed or the index is tainted then it reports it.

This meant that in situations where overflow and underflow are both
possible (but the index is either tainted or guaranteed to be invalid),
the checker was reporting just an overflow error.

This commit modifies the messages printed in these cases to mention the
possibility of an underflow.

---------

Co-authored-by: Balazs Benics <benicsbalazs at gmail.com>



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