Skip to content

Fix improper vector iterator handling and a couple of warnings#24664

Merged
yuslepukhin merged 2 commits intomainfrom
yuslepukhin/trt_vector_erase
May 7, 2025
Merged

Fix improper vector iterator handling and a couple of warnings#24664
yuslepukhin merged 2 commits intomainfrom
yuslepukhin/trt_vector_erase

Conversation

@yuslepukhin
Copy link
Member

Description

When erasing elements from a vector while iterating over it, the iterator must be updated to the new position after the erase operation as a return value, otherwise results in decrement of end operator which is undefined behavior.
Fix a couple of warnings as well.

Motivation and Context

Causes test assert.

@yuslepukhin yuslepukhin requested a review from chilo-ms May 6, 2025 23:47
@yuslepukhin yuslepukhin marked this pull request as ready for review May 6, 2025 23:47
@yuslepukhin yuslepukhin requested a review from HectorSVC May 6, 2025 23:49
HectorSVC
HectorSVC previously approved these changes May 7, 2025
Copy link
Contributor

@HectorSVC HectorSVC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@yuslepukhin yuslepukhin marked this pull request as draft May 7, 2025 01:17
@yuslepukhin yuslepukhin marked this pull request as ready for review May 7, 2025 01:21
Copy link
Contributor

@HectorSVC HectorSVC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@yuslepukhin yuslepukhin merged commit dc09448 into main May 7, 2025
92 of 98 checks passed
@yuslepukhin yuslepukhin deleted the yuslepukhin/trt_vector_erase branch May 7, 2025 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants