[all-commits] [llvm/llvm-project] 5cf853: [clang][analyzer] Extend StreamChecker with some n...

Balázs Kéri via All-commits all-commits at lists.llvm.org
Fri Jan 6 03:23:26 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5cf85323a0788ee5666099d6a34c55f70edbc934
      https://github.com/llvm/llvm-project/commit/5cf85323a0788ee5666099d6a34c55f70edbc934
  Author: Balázs Kéri <1.int32 at gmail.com>
  Date:   2023-01-06 (Fri, 06 Jan 2023)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
    M clang/test/Analysis/Inputs/system-header-simulator.h
    A clang/test/Analysis/stream-errno-note.c
    A clang/test/Analysis/stream-errno.c
    M clang/test/Analysis/stream-error.c
    A clang/test/Analysis/stream-noopen.c

  Log Message:
  -----------
  [clang][analyzer] Extend StreamChecker with some new functions.

The stream handling functions `ftell`, `rewind`, `fgetpos`, `fsetpos`
are evaluated in the checker more exactly than before.
New tests are added to test behavior of the checker together with
StdLibraryFunctionsChecker. The option ModelPOSIX of that checker
affects if (most of) the stream functions are recognized, and checker
StdLibraryFunctionArgs generates warnings if constraints for arguments
are not satisfied. The state of `errno` is set by StdLibraryFunctionsChecker
too for every case in the stream functions.
StreamChecker works with the stream state only, does not set the errno state,
and is not dependent on other checkers.

Reviewed By: Szelethus

Differential Revision: https://reviews.llvm.org/D140395




More information about the All-commits mailing list