[all-commits] [llvm/llvm-project] 957014: [clang][Analyzer] Add errno state to standard func...

Balázs Kéri via All-commits all-commits at lists.llvm.org
Mon Jun 20 23:57:49 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 957014da2d2791359181d89a04a0d27da65474d4
      https://github.com/llvm/llvm-project/commit/957014da2d2791359181d89a04a0d27da65474d4
  Author: Balázs Kéri <1.int32 at gmail.com>
  Date:   2022-06-21 (Tue, 21 Jun 2022)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
    A clang/test/Analysis/errno-stdlibraryfunctions-notes.c
    A clang/test/Analysis/errno-stdlibraryfunctions.c

  Log Message:
  -----------
  [clang][Analyzer] Add errno state to standard functions modeling.

This updates StdLibraryFunctionsChecker to set the state of 'errno'
by using the new errno_modeling functionality.
The errno value is set in the PostCall callback. Setting it in call::Eval
did not work for some reason and then every function should be
EvalCallAsPure which may be bad to do. Now the errno value and state
is not allowed to be checked in any PostCall checker callback because
it is unspecified if the errno was set already or will be set later
by this checker.

Reviewed By: martong, steakhal

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




More information about the All-commits mailing list