Skip to content

Commit bd5477c

Browse files
committed
Fix incorrect length of display name when tracing ETW events for the JIT queue.
Fixes:#5631
1 parent 70aa49a commit bd5477c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/Backend/CodeGenWorkItem.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,11 @@ struct JsFunctionCodeGen sealed : public CodeGenWorkItem
213213
{
214214
const WCHAR* name = functionBody->GetExternalDisplayName();
215215
size_t nameSizeInChars = wcslen(name) + 1;
216-
size_t sizeInBytes = nameSizeInChars * sizeof(WCHAR);
217-
if(displayName == NULL || sizeInChars < nameSizeInChars)
216+
if (displayName == NULL || sizeInChars < nameSizeInChars)
218217
{
219-
return nameSizeInChars;
218+
return nameSizeInChars;
220219
}
221-
js_wmemcpy_s(displayName, sizeInChars, name, sizeInBytes);
220+
js_wmemcpy_s(displayName, nameSizeInChars, name, nameSizeInChars);
222221
return nameSizeInChars;
223222
}
224223

0 commit comments

Comments
 (0)