Page MenuHomePhabricator

Add an assertion in SmallVector::push_back()
AcceptedPublic

Authored by mehdi_amini on Jul 21 2020, 9:43 PM.

Details

Reviewers
bkramer
Summary

This assertion ensures the input value isn't part of the vector when
growing is required. In such cases the vector will grow and the input
value is invalidated before being read from.

This found 14 failed Tests.

Diff Detail

Event Timeline

mehdi_amini created this revision.Jul 21 2020, 9:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2020, 9:43 PM
bkramer accepted this revision.Jul 22 2020, 1:57 AM

Thanks!

This revision is now accepted and ready to land.Jul 22 2020, 1:57 AM
mehdi_amini marked an inline comment as done.Jul 22 2020, 10:08 AM
mehdi_amini added inline comments.
llvm/include/llvm/MC/MCInst.h
187

Actually this is working around the assertion, but not fixing it.
The reference passed as input is invalidated by the reserve I think.