Closed
Bug 400393
Opened 18 years ago
Closed 18 years ago
mozilla-central: jsatom.cpp has bad casts in 64-bit OS
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9beta2
People
(Reporter: benjamin, Assigned: benjamin)
Details
Attachments
(1 file, 1 obsolete file)
|
552 bytes,
patch
|
igor
:
review+
mtschrep
:
approval1.9+
|
Details | Diff | Splinter Review |
jsatom.cpp has bad casts on a 64-bit OS: you aren't allowed to cast a pointer directly to a uint32... you always have to go through a uintN first.
Comment 1•18 years ago
|
||
JS_PTR_TO_{,U}INT32 stand ready. Where are these errors?
Igor, can you fix?
/be
| Assignee | ||
Comment 2•18 years ago
|
||
This is the patch I thought I attached the first time... :-(
Attachment #285485 -
Flags: review?(igor)
Comment 3•18 years ago
|
||
Comment on attachment 285485 [details] [diff] [review]
Make it cast correctly, rev. 1
Right-justify backslash to column 79 for prevailing style match.
/be
Comment 4•18 years ago
|
||
Comment on attachment 285485 [details] [diff] [review]
Make it cast correctly, rev. 1
>diff --git a/js/src/jsatom.h b/js/src/jsatom.h
>--- a/js/src/jsatom.h
>+++ b/js/src/jsatom.h
>@@ -74,7 +74,7 @@ JS_STATIC_ASSERT(sizeof(JSAtom *) == JS_
> #if JS_BYTES_PER_WORD == 4
> # define ATOM_HASH(atom) ((JSHashNumber)(atom) >> 2)
> #elif JS_BYTES_PER_WORD == 8
>-# define ATOM_HASH(atom) (((JSHashNumber)(atom) >> 3) ^ \
>+# define ATOM_HASH(atom) (((JSHashNumber)(jsuword)(atom) >> 3) ^ \
> (JSHashNumber)((jsuword)(atom) >> 32))
Nit: put \ in the column 78 as it was before the patch.
r+ with that fixed.
Comment 5•18 years ago
|
||
(In reply to comment #4)
> (From update of attachment 285485 [details] [diff] [review])
> >diff --git a/js/src/jsatom.h b/js/src/jsatom.h
> >--- a/js/src/jsatom.h
> >+++ b/js/src/jsatom.h
> >@@ -74,7 +74,7 @@ JS_STATIC_ASSERT(sizeof(JSAtom *) == JS_
> > #if JS_BYTES_PER_WORD == 4
> > # define ATOM_HASH(atom) ((JSHashNumber)(atom) >> 2)
> > #elif JS_BYTES_PER_WORD == 8
> >-# define ATOM_HASH(atom) (((JSHashNumber)(atom) >> 3) ^ \
> >+# define ATOM_HASH(atom) (((JSHashNumber)(jsuword)(atom) >> 3) ^ \
> > (JSHashNumber)((jsuword)(atom) >> 32))
>
> Nit: put \ in the column 78 as it was before the patch.
I meant 79 in editors that counts columns from 1.
| Assignee | ||
Comment 6•18 years ago
|
||
Pushed to mozilla-central. Igor, could you go ahead and set the review flag when you do reviews so that my review requests stay clean?
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment 7•18 years ago
|
||
This should get patched in cvs.mozilla.org too.
/be
| Assignee | ||
Comment 8•18 years ago
|
||
Why fix in CVS? This isn't a problem in C, only in C++ due to different casting rules.
Comment 9•18 years ago
|
||
(In reply to comment #6)
> Pushed to mozilla-central. Igor, could you go ahead and set the review flag
> when you do reviews so that my review requests stay clean?
Do you have a patch to attach with the nit addressed?
Comment 10•18 years ago
|
||
(In reply to comment #8)
> Why fix in CVS? This isn't a problem in C, only in C++ due to different casting
> rules.
Two reasons:
1. To allow 1.9 and mozilla-central to stay as close as possbile.
2. To allow to use C++ compiler with 1.9.
Comment 11•18 years ago
|
||
(In reply to comment #8)
> Why fix in CVS? This isn't a problem in C, only in C++ due to different casting
> rules.
Igor replied, but did not cite bug 357016 which was fixed on cvs.m.o in reason 2. Connect the dots, and don't make gratuitous small changes between SpiderMonkey in cvs and hg, please.
/be
| Assignee | ||
Comment 12•18 years ago
|
||
New patch... though if you're going to say r+ in comments with a nit changed, you might as well mark it so.
Assignee: general → benjamin
Attachment #285485 -
Attachment is obsolete: true
Status: RESOLVED → ASSIGNED
Attachment #285501 -
Flags: review?(igor)
Attachment #285501 -
Flags: approval1.9?
Attachment #285485 -
Flags: review?(igor)
Resolution: FIXED → ---
Updated•18 years ago
|
Attachment #285501 -
Flags: review?(igor) → review+
Comment 13•18 years ago
|
||
(In reply to comment #12)
> Created an attachment (id=285501) [details]
> Make it cast correctly, rev. 1.1
>
> New patch...
Thanks, I just wanted to have a patch to apply to 1.9 as well. Do you have CVS access to commit the patch (after getting a+)?
Updated•18 years ago
|
Attachment #285501 -
Flags: approval1.9? → approval1.9+
| Assignee | ||
Updated•18 years ago
|
Keywords: checkin-needed
Comment 14•18 years ago
|
||
Checking in js/src/jsatom.h;
/cvsroot/mozilla/js/src/jsatom.h,v <-- jsatom.h
new revision: 3.77; previous revision: 3.76
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago → 18 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M10
Updated•18 years ago
|
Flags: in-testsuite-
Flags: in-litmus-
You need to log in
before you can comment on or make changes to this bug.
Description
•