[all-commits] [llvm/llvm-project] 7dd281: Fix MSAN failure on Function destruction

Evgenii Stepanov via All-commits all-commits at lists.llvm.org
Thu Feb 6 15:10:11 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7dd2810907b87fbecb2ca7c111c2ad37bf1563e9
      https://github.com/llvm/llvm-project/commit/7dd2810907b87fbecb2ca7c111c2ad37bf1563e9
  Author: Evgenii Stepanov <eugenis at google.com>
  Date:   2020-02-06 (Thu, 06 Feb 2020)

  Changed paths:
    M llvm/lib/IR/Value.cpp

  Log Message:
  -----------
  Fix MSAN failure on Function destruction

Summary:
When Function is destroyed, GlobalValue base class is destroyed, then
Value destructor would call use_empty, which ultimately attempts to
downcast 'this' to GlobalValue. This is UB, and is caught my MSAN as
accessing uninitialized memory.

Call materialized_use_empty, which doesn't call
assertModuleIsMaterializedImpl().

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

Patch by Antonio Maiorano.




More information about the All-commits mailing list