Skip to content

Commit

Permalink
[MERGE #5632 @VSadov] Fix incorrect length of display name when traci…
Browse files Browse the repository at this point in the history
…ng ETW events for the JIT queue.

Merge pull request #5632 from VSadov:fix5631

Fix incorrect length of display name when tracing ETW events for the JIT queue.

Fixes:#5631
  • Loading branch information
VSadov committed Aug 24, 2018
2 parents 70aa49a + bd5477c commit ebe9f3f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Backend/CodeGenWorkItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,11 @@ struct JsFunctionCodeGen sealed : public CodeGenWorkItem
{
const WCHAR* name = functionBody->GetExternalDisplayName();
size_t nameSizeInChars = wcslen(name) + 1;
size_t sizeInBytes = nameSizeInChars * sizeof(WCHAR);
if(displayName == NULL || sizeInChars < nameSizeInChars)
if (displayName == NULL || sizeInChars < nameSizeInChars)
{
return nameSizeInChars;
return nameSizeInChars;
}
js_wmemcpy_s(displayName, sizeInChars, name, sizeInBytes);
js_wmemcpy_s(displayName, nameSizeInChars, name, nameSizeInChars);
return nameSizeInChars;
}

Expand Down

0 comments on commit ebe9f3f

Please sign in to comment.