From 87581792ff565e04f3c3b19012124e307d013f1b Mon Sep 17 00:00:00 2001 From: jiangchao_j Date: Sat, 29 Mar 2025 17:48:39 +0800 Subject: [PATCH] check if ptr is nullptr --- .../msprobe/ccsrc/if/mindspore/MindSporeDbgHook.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debug/accuracy_tools/msprobe/ccsrc/if/mindspore/MindSporeDbgHook.cpp b/debug/accuracy_tools/msprobe/ccsrc/if/mindspore/MindSporeDbgHook.cpp index 42f3a2e5b61..db279a33f17 100644 --- a/debug/accuracy_tools/msprobe/ccsrc/if/mindspore/MindSporeDbgHook.cpp +++ b/debug/accuracy_tools/msprobe/ccsrc/if/mindspore/MindSporeDbgHook.cpp @@ -34,6 +34,9 @@ EXPORT_SYMBOL void MS_DbgOnStepBegin(uint32_t device, int32_t curStep, } /* mindspore使用了_GLIBCXX_USE_CXX11_ABI=0,为了解决CXX版本兼容问题,此处将string转char*使用 */ if (ext.first == static_cast(MindStudioDebugger::MindStudioExtensionArgs::ALL_KERNEL_NAMES)) { + if (ext.second == nullptr) { + continue; + } std::vector* ss = reinterpret_cast*>(ext.second); strBuf = new const char*[(*ss).size() + 1]; strBuf[(*ss).size()] = nullptr; -- Gitee