Skip to content

2nd-batch-23-对end()迭代器解引用#75353

Merged
luotao1 merged 1 commit intoPaddlePaddle:developfrom
ApricityXX:2nd_batch_23
Sep 19, 2025
Merged

2nd-batch-23-对end()迭代器解引用#75353
luotao1 merged 1 commit intoPaddlePaddle:developfrom
ApricityXX:2nd_batch_23

Conversation

@ApricityXX
Copy link
Contributor

@ApricityXX ApricityXX commented Sep 18, 2025

PR Category

Execute Infrastructure

PR Types

Bug fixes

Description

第二批-编号23(共1处)

records_.end() 指向容器末尾之后的位置,不能被解引用。表达式 records_.end()-- 返回 end() 的副本(即指向末尾之后),然后对该副本进行递减操作,但由于是后缀自减,表达式值仍是递减前的 end()。因此 *(records_.end()--) 实际上是对 end() 迭代器解引用,这是未定义行为,可能导致崩溃。

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@b1add41). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             develop    #75353   +/-   ##
===========================================
  Coverage           ?   100.00%           
===========================================
  Files              ?         1           
  Lines              ?         1           
  Branches           ?         0           
===========================================
  Hits               ?         1           
  Misses             ?         0           
  Partials           ?         0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@luotao1 luotao1 merged commit 969d138 into PaddlePaddle:develop Sep 19, 2025
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants