[all-commits] [llvm/llvm-project] 3043e5: ADT: Fix reference invalidation in N-element Small...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Wed Jan 13 20:25:24 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3043e5a5c33c4c871f4a1dfd621a8839f9a1f0b3
      https://github.com/llvm/llvm-project/commit/3043e5a5c33c4c871f4a1dfd621a8839f9a1f0b3
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2021-01-13 (Wed, 13 Jan 2021)

  Changed paths:
    M llvm/include/llvm/ADT/SmallVector.h
    M llvm/unittests/ADT/SmallVectorTest.cpp

  Log Message:
  -----------
  ADT: Fix reference invalidation in N-element SmallVector::append and insert

For small enough, trivially copyable `T`, take the parameter by-value in
`SmallVector::append` and `SmallVector::insert`.  Otherwise, when
growing, update the arugment appropriately.

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




More information about the All-commits mailing list