Skip to content

Commit

Permalink
[1.11>master] [MERGE #5632 @VSadov] Fix incorrect length of display n…
Browse files Browse the repository at this point in the history
…ame when tracing 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 be90419 + ebe9f3f commit d3ac17e
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 d3ac17e

Please sign in to comment.