已合并
fix(machine): Initialize HostMachine curTask to nullptr #5886
chaizhengtong创建于 9月3日
fix(machine): Initialize HostMachine curTask to nullptr #5886
已合并
chaizhengtong创建于 9月3日
chaizhengtong
chaizhengtong成员
9月3日
curTask未赋值时 明确为空指针:
等后面 new MachineTask(...) 真正赋值。
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 chaizhengtong 的贡献)
chaizhengtongchaizhengtong成员
9月3日 创建了 pull request,commit 1dd9ece9
atomgit-bot
atomgit-bot
9月3日 评论:

变更摘要

本 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
不准确?
atomgit-bot
atomgit-bot
9月3日 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
9月3日 添加了label:cann-cla/yes
chaizhengtongchaizhengtong成员
9月3日 关联了issue:【缺陷报告】访问未初始化的指针 - 文件host_machine.cpp - 函数SubTask - 行号206
CANN-robot
CANN-robot成员
9月3日 评论:

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-robot成员
9月3日 将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设为评审人
CANN-robotCANN-robot成员
9月3日 将jason_yuan_ye,yinjie27_,tsungl4,gaoxingwang,linjiashu设为审查人
chaizhengtong
chaizhengtong成员
9月3日 评论:

compile

likedislike
chaizhengtongchaizhengtong成员
9月3日 预合并成功(commit_id: 2c531ebc94b1fd9260ec06dc5d22dabd225e0905)
CANN-robot
CANN-robot成员
9月3日 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
9月3日 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
9月3日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
9月3日 添加了label:ci-pipeline-passed
chaizhengtongchaizhengtong成员
9月3日 修改了pull request 的描述
袁野
袁野成员
9月4日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
9月4日 添加了label:approved
gaoxingwang
gaoxingwang成员
9月4日 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
9月4日 添加了label:lgtm
CANN-robotCANN-robot成员
9月4日 合入了pull request