[all-commits] [llvm/llvm-project] b30521: [analyzer] Wrong type cast occurs during pointer d...

Denys Petrov via All-commits all-commits at lists.llvm.org
Wed Apr 28 15:04:02 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b30521c28a4dc1b94d793385e4144ede5822b2c1
      https://github.com/llvm/llvm-project/commit/b30521c28a4dc1b94d793385e4144ede5822b2c1
  Author: Denys Petrov <dpetrov at accesssoftek.com>
  Date:   2021-04-29 (Thu, 29 Apr 2021)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
    M clang/test/Analysis/casts.c
    M clang/test/Analysis/string.c

  Log Message:
  -----------
  [analyzer] Wrong type cast occurs during pointer dereferencing after type punning

Summary: During pointer dereferencing CastRetrievedVal uses wrong type from the Store after type punning. Namely, the pointer casts to another type and then assigns with a value of one more another type. It produces NonLoc value when Loc is expected.

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

Fixes:
https://bugs.llvm.org/show_bug.cgi?id=37503
https://bugs.llvm.org/show_bug.cgi?id=49007




More information about the All-commits mailing list