Merged
fix(machine): Initialize HostMachine curTask to nullptr #5886
chaizhengtongAdd on Sep 3
fix(machine): Initialize HostMachine curTask to nullptr #5886
Merged
chaizhengtongAdd on Sep 3
chaizhengtong
chaizhengtongCollaborators
Sep 3
curTask未赋值时 明确为空指针:
等后面 new MachineTask(...) 真正赋值。
likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for chaizhengtong's contribution.)
chaizhengtongchaizhengtongCollaborators
Sep 3 Created pull request, commit 1dd9ece9
atomgit-bot
atomgit-bot
Sep 3 Comments:

变更摘要

本 PR 针对 HostMachine 的成员指针 curTask 进行初始化修复:将原本未赋初值的裸指针声明改为使用空指针初始化 MachineTask* curTask{nullptr},使 curTask 在尚未通过 new MachineTask(...) 真正赋值前明确为空指针,避免因未初始化而持有不确定值。

主要改动

  • 初始化 curTask 成员指针: 在 framework/src/interface/machine/host/host_machine.h 中将 MachineTask* curTask; 改为 MachineTask* curTask{nullptr};,保证对象构造后 curTask 即为明确的空指针
  • 明确赋值时机语义: 与 PR 背景说明一致,curTask 只有在后续执行 new MachineTask(...) 时才完成真正赋值,本次改动消除了此前"未赋值"状态下的不确定性
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 3 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Sep 3 Added label: cann-cla/yes
chaizhengtongchaizhengtongCollaborators
Sep 3 Associated issue: 【缺陷报告】访问未初始化的指针 - 文件host_machine.cpp - 函数SubTask - 行号206
CANN-robot
CANN-robotCollaborators
Sep 3 Comments:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
framework/src/interface/machine ✅ jason_yuan_ye, gaoxingwang (2/2) ✅ jason_yuan_ye (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

chai-hw, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robotCollaborators
Sep 3 Set xinweiliu,cam_bxh,dai-zhentao,lululu40888,shi-dingkun,gguuaanngg,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
CANN-robotCANN-robotCollaborators
Sep 3 Set jason_yuan_ye,yinjie27_,tsungl4,gaoxingwang,linjiashu as approver
chaizhengtong
chaizhengtongCollaborators
Sep 3 Comments:

compile

likedislike
chaizhengtongchaizhengtongCollaborators
Sep 3 Pre merge succeeded (commit_id: 2c531ebc94b1fd9260ec06dc5d22dabd225e0905)
CANN-robot
CANN-robotCollaborators
Sep 3 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 3 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 3 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 3 Added label: ci-pipeline-passed
chaizhengtongchaizhengtongCollaborators
Sep 3 Modify description of pull request
袁野
袁野Collaborators
Sep 4 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 4 Added label: approved
gaoxingwang
gaoxingwangCollaborators
Sep 4 Comments:

/lgtm

likedislike
CANN-robotCANN-robotCollaborators
Sep 4 Added label: lgtm
CANN-robotCANN-robotCollaborators
Sep 4 Merged pull request