This is an archive of the discontinued LLVM Phabricator instance.

Fix SafeIntIterator reference type
ClosedPublic

Authored by gchatelet on Mar 6 2023, 6:15 AM.

Details

Summary

We explicitly state that the reference type for Sequence iterator is a value_type.
Since the iterator is a lazy generator, it cannot point to any memory and so it cannot have a reference type.
Fixes https://github.com/llvm/llvm-project/issues/61122

Diff Detail

Event Timeline

gchatelet created this revision.Mar 6 2023, 6:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2023, 6:15 AM
gchatelet requested review of this revision.Mar 6 2023, 6:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2023, 6:15 AM
foad added a comment.Mar 6 2023, 6:27 AM

Thanks for the fix! Unfortunately I am not competent to review it.

kuhar accepted this revision.Mar 6 2023, 7:08 AM

LGTM, thanks for the fix. Just a couple of nits.

Fix #61122

Could you make the commit line more specific? Maybe something like 'Fix SafeIntIterator reference type'.

llvm/unittests/ADT/SequenceTest.cpp
299

nit: Could you rename this or add a comment explaining what the intention is behind this test?

This revision is now accepted and ready to land.Mar 6 2023, 7:08 AM
gchatelet updated this revision to Diff 502644.Mar 6 2023, 7:25 AM

rebase, rename test and retitle commit

gchatelet retitled this revision from Fix #61122 to Fix SafeIntIterator reference type.Mar 6 2023, 7:26 AM
gchatelet marked an inline comment as done.

Thx for the review.

This revision was landed with ongoing or failed builds.Mar 6 2023, 7:28 AM
This revision was automatically updated to reflect the committed changes.