Closed
Bug 361362
Opened 18 years ago
Closed 18 years ago
js/src/jsemit.c assumes sizeof(int) == sizeof(ptrdiff_t)
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: martin, Unassigned)
References
Details
(Keywords: verified1.8.0.9, verified1.8.1.1)
Attachments
(1 file)
422 bytes,
patch
|
brendan
:
review+
jay
:
approval1.8.0.9+
jay
:
approval1.8.1.1+
|
Details | Diff | Splinter Review |
Obviously this does not work on plattforms where sizeof(int) != sizeof(ptrdiff_t):
int noteIndex;
EmitVariables(cx, cg, pn, JS_FALSE, ¬eIndex);
For example on NetBSD/sparc64 this makes firefox (and regchrome during installation) dump core due to a bus error - int has four byte alignement, while ptrdiff_t requires eight byte alignment.
Reporter | ||
Comment 1•18 years ago
|
||
This is how I patched it locally (in NetBSD's pkgsrc), which made it work for me.
Updated•18 years ago
|
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
Comment 2•18 years ago
|
||
Fixed on trunk, thanks:
$ cvs ci -m"Fix from Martin Husemann <martin@NetBSD.ORG> for int-instead-of-ptrdiff_t abusage (361362, r=me)." jsemit.c
Checking in jsemit.c;
/cvsroot/mozilla/js/src/jsemit.c,v <-- jsemit.c
new revision: 3.229; previous revision: 3.228
done
/be
Blocks: js1.7src
Status: NEW → RESOLVED
Closed: 18 years ago
Flags: blocking1.8.1.1?
Flags: blocking1.8.0.9?
Resolution: --- → FIXED
Comment 3•18 years ago
|
||
Comment on attachment 246128 [details] [diff] [review]
Change a variable from int to ptrdiff_t to assure proper alignment
Safe portability fix.
/be
Attachment #246128 -
Flags: review+
Attachment #246128 -
Flags: approval1.8.1.1?
Attachment #246128 -
Flags: approval1.8.0.9?
Updated•18 years ago
|
Flags: blocking1.8.1.1?
Flags: blocking1.8.1.1-
Flags: blocking1.8.0.9?
Flags: blocking1.8.0.9-
Comment 4•18 years ago
|
||
Comment on attachment 246128 [details] [diff] [review]
Change a variable from int to ptrdiff_t to assure proper alignment
Approved for landing on both 1.8.0 and 1.8.1 branches, a=jay for drivers.
Attachment #246128 -
Flags: approval1.8.1.1?
Attachment #246128 -
Flags: approval1.8.1.1+
Attachment #246128 -
Flags: approval1.8.0.9?
Attachment #246128 -
Flags: approval1.8.0.9+
Comment 5•18 years ago
|
||
Fixed on the 1.8 branch:
Checking in jsemit.c;
/cvsroot/mozilla/js/src/jsemit.c,v <-- jsemit.c
new revision: 3.128.2.60; previous revision: 3.128.2.59
done
and on the 1.8.0 branch:
Checking in jsemit.c;
/cvsroot/mozilla/js/src/jsemit.c,v <-- jsemit.c
new revision: 3.128.2.3.2.13; previous revision: 3.128.2.3.2.12
done
/be
Keywords: fixed1.8.0.9,
fixed1.8.1.1
Updated•18 years ago
|
Flags: in-testsuite-
Comment 6•18 years ago
|
||
Verified fixed on trunk, 1.8.1 branch and 1.8.0.x branch by code inspection.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•