[PATCH] D84293: Add an assertion in SmallVector::push_back()

Sean Silva via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 14:22:43 PST 2020


silvas added inline comments.


================
Comment at: llvm/include/llvm/MC/MCInst.h:187
+    Operands.push_back(Op);
+  }
 
----------------
mehdi_amini wrote:
> Actually this is working around the assertion, but not fixing it.
> The reference passed as input is invalidated by the reserve I think.
Could we switch this to take MCOperand by value? A copy is going to be made in the push_back anyway.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84293/new/

https://reviews.llvm.org/D84293



More information about the llvm-commits mailing list