[all-commits] [llvm/llvm-project] 0de3d1: [llvm] Add assertions for the smart pointers with ...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Fri Mar 19 13:55:10 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0de3d1c81428c2a7a4f9a23a5105aa2243fad778
      https://github.com/llvm/llvm-project/commit/0de3d1c81428c2a7a4f9a23a5105aa2243fad778
  Author: Ella Ma <alansnape3058 at gmail.com>
  Date:   2021-03-19 (Fri, 19 Mar 2021)

  Changed paths:
    M llvm/tools/llvm-link/llvm-link.cpp

  Log Message:
  -----------
  [llvm] Add assertions for the smart pointers with the possibility to be null in ModuleLazyLoaderCache::operator()

Split from D91844.

The return value of function `ModuleLazyLoaderCache::operator()` in file llvm/tools/llvm-link/llvm-link.cpp. According to the bug report of my static analyzer, the std::function variable `ModuleLazyLoaderCache::createLazyModule` points to function `loadFile`, which may return `nullptr` when error. And the pointer is dereferenced without a check.

Reviewed By: tejohnson

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




More information about the All-commits mailing list