Closed
Bug 209814
Opened 21 years ago
Closed 20 years ago
PR_dtoa blows up when executed on an ARM platform
Categories
(NSPR :: NSPR, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
4.5
People
(Reporter: darin.moz, Assigned: darin.moz)
References
Details
Attachments
(1 file, 2 obsolete files)
2.47 KB,
patch
|
darin.moz
:
review+
brendan
:
approval1.7b+
|
Details | Diff | Splinter Review |
despite the fact that ARM is a little endian architecture, it stores doubles in big endian format. this means that the conversion macros in prdtoa.c (word0 and word1) need to be defined differently for the ARM platform.
Assignee | ||
Comment 1•21 years ago
|
||
note: this patch is basically ripped from mozilla/js/src/jsnum.h
Comment 2•21 years ago
|
||
Comment on attachment 125923 [details] [diff] [review] v1 patch >-#ifdef IEEE_8087 >+#ifdef IEEE_8087 && !defined(CPU_IS_ARM) Instead of this, I think we should say: #if defined(IS_LITTLE_ENDIAN) && !defined(CPU_IS_ARM) #define IEEE_8087 #else #define IEEE_MC68k #endif Also, maybe we should also test for defined(LINUX), because there are other OS's that run on ARM and I'm not sure if they also need this fix.
Assignee | ||
Comment 3•21 years ago
|
||
wtc: i originally wrote code like that and it didn't work. the problem is that we need to assume IEEE_8087 semantics in all cases except when we try to access the individual DWORDs stored in a double. you see, the DWORDS are stored in reverse order, but are still little endian. also, i'm pretty sure the same format is used by WinCE. i think we should try to follow what spidermonkey (mozjs) does, which is the patch i wrote.
Assignee | ||
Comment 4•21 years ago
|
||
so, this bug causes NSS initialization to fail on ARM. NSS appears to be the only caller of PR_dtoa. wan-teh: your thoughts on comment #3 ?
Assignee | ||
Comment 5•21 years ago
|
||
the previous patch was malformed (i think i must have edited it without testing). this is what i meant.
Attachment #125923 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #136507 -
Flags: review?(wchang0222)
Comment 7•21 years ago
|
||
Darin, I believe that something along the line of this patch should work. I added a new case for IEEE arithmetic called IEEE_ARM. For the word0 and word1 macros, IEEE_ARM is treated like IEEE_MC68k (big endian). For the Storeinc macro, IEEE_ARM is treated like IEEE_8087 (little endian). Please review and test this patch. Please run the dtoa.c and strod.c tests in nsprpub/pr/tests. Thanks.
Assignee | ||
Comment 8•20 years ago
|
||
Comment on attachment 141345 [details] [diff] [review] wtc's alternate patch dtoa test passed. patch looks good to me. r=darin thanks wtc!
Attachment #141345 -
Flags: review+
Assignee | ||
Updated•20 years ago
|
Attachment #136507 -
Attachment is obsolete: true
Attachment #136507 -
Flags: review?(wchang0222)
Assignee | ||
Comment 9•20 years ago
|
||
Comment on attachment 141345 [details] [diff] [review] wtc's alternate patch requesting approval to land this patch. it only affects the ARM build of NSPR.
Attachment #141345 -
Flags: approval1.7b?
Comment 10•20 years ago
|
||
Comment on attachment 141345 [details] [diff] [review] wtc's alternate patch a=brendan@mozilla.org for 1.7b. /be
Attachment #141345 -
Flags: approval1.7b? → approval1.7b+
Assignee | ||
Comment 11•20 years ago
|
||
fixed NSPRPUB_PRE_4_2_CLIENT_BRANCH for mozilla 1.7 beta ... and the NSPR trunk.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Target Milestone: --- → 4.5
You need to log in
before you can comment on or make changes to this bug.
Description
•