2c196bbc6bd897b3dcc1d87a3baac28e1e88df41 asserted that
SmallVector::push_back doesn't invalidate the parameter when it needs
to grow. Do the same for resize, append, assign, insert, and
emplace_back.
Details
Diff Detail
Unit Tests
Event Timeline
llvm/include/llvm/ADT/SmallVector.h | ||
---|---|---|
735 | Do you need the SFINAE and the two implementation? |
Updates:
- Per @mehdi_amini's suggestion, check all arguments of emplace_back.
- Check ranges in the iterator range versions of assign, append, and insert.
llvm/include/llvm/ADT/SmallVector.h | ||
---|---|---|
735 | In fact we can also check for internal references in the multi-argument versions of emplace_back. The new patch does this... thanks! |
Running check-all for llvm/clang/clang-tools-extra hit three more assertions, now fixed (since splitting the patch out from https://reviews.llvm.org/D91467 I'd just run ADTTests until now):
- Two MCInst::insert calls.
- One emplace_back call with an internal reference.
I'll commit in a minute.
clang-tidy: warning: invalid case style for function 'emplace_back_impl' [readability-identifier-naming]
not useful