已关闭
[Bug-Report|缺陷反馈]: 检视代码发现use-free-after #4162
丛吉钰创建于  7月20日关闭于  7月20日
丛吉钰
丛吉钰成员
7月20日 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

if (workspace_size != 0) { \
at::TensorOptions options = at::TensorOptions(torch_npu::utils::get_npu_device_type()); \
auto workspace_tensor = at::empty({workspace_size}, options.dtype(at::kByte)); \
workspace_addr = const_cast<void*>(workspace_tensor.storage().data()); \
}
在if中如果代码块结束,会导致workspace_addr悬空。

Environment / 环境信息 (Mandatory / 必填)

不涉及

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

代码检视

Describe the expected behavior / 预期结果 (Mandatory / 必填)

代码逻辑正常,功能正常跑通

代码检视

Special notes for this issue/备注 (Optional / 选填)

likedislike
丛吉钰丛吉钰成员
7月20日 添加了label:bug-report
丛吉钰丛吉钰成员
7月20日 将 cong-jiyu 设为负责人
CANN-robotCANN-robot成员
7月20日 关闭了 issue
CANN-robotCANN-robot成员
7月20日 添加了label:resolved