Closed
Bug 876366
Opened 12 years ago
Closed 12 years ago
Avoid pointer to long casts in PerfSpewer::writeProfile.
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: jacek, Assigned: jacek)
References
Details
Attachments
(1 file)
1.95 KB,
patch
|
nmatsakis
:
review-
|
Details | Diff | Splinter Review |
unsigned long is 32-bit on 64-bit Windows, so those casts are problematic there. The patch uses uintptr_t instead and avoids casts in printf call by using "%p" format.
Attachment #754395 -
Flags: review?(nmatsakis)
Comment 1•12 years ago
|
||
Comment on attachment 754395 [details] [diff] [review]
fix
Review of attachment 754395 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/ion/PerfSpewer.cpp
@@ +135,5 @@
> uint32_t thisFunctionIndex = nextFunctionIndex++;
>
> if (PerfFuncEnabled()) {
> fprintf(fp_,
> + "%p %p %s:%d: Func%02d\n",
I specifically chose not to use `%p` because it outputs a string like `0xABCDEFGH`, but I want `ABCDEFGH`. Perhaps rewrite the patch to use `PRIxPTR`? Alternatively, is there a way to make the cast not warn (reinterpret_cast, perhaps?)
Attachment #754395 -
Flags: review?(nmatsakis) → review-
Assignee | ||
Comment 2•12 years ago
|
||
I pushed a fix using reinterpret_cast. Thanks for review.
https://hg.mozilla.org/integration/mozilla-inbound/rev/7c0c49dd4e91
Comment 3•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in
before you can comment on or make changes to this bug.
Description
•