[all-commits] [llvm/llvm-project] 3ce43c: [WebKit checkers] Don't treat virtual functions as...

Ryosuke Niwa via All-commits all-commits at lists.llvm.org
Mon Mar 10 21:02:01 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3ce43c8b16a6aefe79ce976b1340ccd493cf533a
      https://github.com/llvm/llvm-project/commit/3ce43c8b16a6aefe79ce976b1340ccd493cf533a
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2025-03-10 (Mon, 10 Mar 2025)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
    M clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
    M clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h
    M clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefCallArgsChecker.cpp
    M clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
    M clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp

  Log Message:
  -----------
  [WebKit checkers] Don't treat virtual functions as safe. (#129632)

Prior to this PR, WebKit checkers erroneously treated functions to be
safe if it has a trivial body even if it was marked as virtual. In the
case of a virtual function, it can have an override which does not pass
the triviality check so we must not make such an assumption.

This PR also restricts the allowed operator overloading while finding
the pointer origin to just operators on smart pointer types: Ref,
RefPtr, CheckedRef, CheckedPtr, RetainPtr, WeakPtr, WeakRef, unique_ptr,
and UniqueRef.



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