Page MenuHomePhabricator

Add an assertion in SmallVector::push_back()
AcceptedPublic

Authored by mehdi_amini on Tue, Jul 21, 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.Tue, Jul 21, 9:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptTue, Jul 21, 9:43 PM
bkramer accepted this revision.Wed, Jul 22, 1:57 AM

Thanks!

This revision is now accepted and ready to land.Wed, Jul 22, 1:57 AM
mehdi_amini marked an inline comment as done.Wed, Jul 22, 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.