Skip to content

Commit d3ac17e

Browse files
committed
[1.11>master] [MERGE chakra-core#5632 @VSadov] Fix incorrect length of display name when tracing ETW events for the JIT queue.
Merge pull request chakra-core#5632 from VSadov:fix5631 Fix incorrect length of display name when tracing ETW events for the JIT queue. Fixes:chakra-core#5631
2 parents be90419 + ebe9f3f commit d3ac17e

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)