[all-commits] [llvm/llvm-project] d88275: [analyzer] Fix a crash for dereferencing an empty ...

Balazs Benics via All-commits all-commits at lists.llvm.org
Tue May 4 07:50:32 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d882750f1105b20d892545e7ebd96f82166dcb53
      https://github.com/llvm/llvm-project/commit/d882750f1105b20d892545e7ebd96f82166dcb53
  Author: Ella Ma <alansnape3058 at gmail.com>
  Date:   2021-05-04 (Tue, 04 May 2021)

  Changed paths:
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h
    A clang/test/Analysis/z3/D83660.c
    A clang/test/Analysis/z3/Inputs/MockZ3_solver_check.c

  Log Message:
  -----------
  [analyzer] Fix a crash for dereferencing an empty llvm::Optional variable in SMTConstraintManager.h.

The first crash reported in the bug report 44338.

Condition `!isSat.hasValue() || isNotSat.getValue()` here should be
`!isNotSat.hasValue() || isNotSat.getValue()`.
`getValue()` here crashed when we used the static analyzer to analyze
postgresql-12.0.

Patch By: OikawaKirie

Reviewed By: steakhal, martong

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




More information about the All-commits mailing list