From a04d83123a8f193b259c02445f4464a6c4e96405 Mon Sep 17 00:00:00 2001 From: Andrey Kvochko Date: Fri, 15 Sep 2017 22:34:04 +0300 Subject: [PATCH] Handle multidimensional arrays --- profiler/profiler/src/profiler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/profiler/profiler/src/profiler.cpp b/profiler/profiler/src/profiler.cpp index 2e5240b..d43ea23 100644 --- a/profiler/profiler/src/profiler.cpp +++ b/profiler/profiler/src/profiler.cpp @@ -221,10 +221,11 @@ static HRESULT GetClassNameFromClassId(ICorProfilerInfo *info, ClassID classId, return hr; size_t namelen = wcslen(wszClass); - if (namelen >= MAX_NAME_LENGTH - 2) + if (namelen >= MAX_NAME_LENGTH - 2 * cRank) return S_FALSE; - - StringCchCopyW(wszClass + namelen, 3, W("[]")); + + for (int i = 0; i < cRank; ++i, namelen += 2) + StringCchCopyW(wszClass + namelen, 3, W("[]")); return S_OK; } -- 2.7.4