[all-commits] [llvm/llvm-project] 260a85: ADT: Fix reference invalidation in SmallVector::re...

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


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 260a856c2abcef49c7cb3bdcd999701db3e2af38
      https://github.com/llvm/llvm-project/commit/260a856c2abcef49c7cb3bdcd999701db3e2af38
  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 SmallVector::resize

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

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




More information about the All-commits mailing list