Closed Bug 106118 Opened 23 years ago Closed 23 years ago

xptcinvoke not handling floating point numbers correctly on AIX

Categories

(Core :: XPConnect, defect)

Other
AIX
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: pkwarren, Assigned: jdunn)

References

Details

Attachments

(1 file)

There are problems in the current xptcinvoke code with the way it handles
passing floating point parameters. This is clearly shown in the output of
TestXPTCInvoke program:

calling direct:
        1 + 1 = 2
        1L + 1L = 2
        2 * 2 = 4
        2L * 2L = 4
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.000000
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.000000f
calling via invoke:
        1 + 1 = 2
        1L + 1L = 2
        2 * 2 = 4
        2L * 2L = 4
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 =
-11885959257070703919456148548600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = -INFf

The problem lies in the assembly code (xptcinvoke_asm_ppc_aix.s), where the
argument "fprData" is prepared in register 6 for the call to
invoke_copy_to_stack, however it is unused (not even shown as a parameter) in
the invoke_copy_to_stack function. I have attached a patch to resolve this
problem. Here is the output of TestXPTCInvoke after the patch is applied:

calling direct:
        1 + 1 = 2
        1L + 1L = 2
        2 * 2 = 4
        2L * 2L = 4
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.000000
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.000000f
calling via invoke:
        1 + 1 = 2
        1L + 1L = 2
        2 * 2 = 4
        2L * 2L = 4
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.000000
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.000000f

This patch also fixes the ability to Increase/Decrease the font size which was
previously broken on AIX.
-> xpconnect
Assignee: dougt → dbradley
Component: XPCOM → XPConnect
Keywords: patch, review
QA Contact: scc → pschwartau
Status: UNCONFIRMED → NEW
Ever confirmed: true
Adding jdunn, since he's the one that originally created this code.
accepting
Status: NEW → ASSIGNED
jdunn, since you're accepting this I'm going to formally assign this to. If
that's no ok just hand it back, thanks.
Assignee: dbradley → jdunn
Status: ASSIGNED → NEW
cc'ing cls, hoping to get a r= out of him.
CLS, this is AIX only!
Status: NEW → ASSIGNED
Comment on attachment 54559 [details] [diff] [review]
fixes floating point problem with xptcinvoke on AIX

r=cls
Attachment #54559 - Flags: review+
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
QA Contact: pschwartau → jdunn
Resolution: --- → FIXED
Check-in verified. I don't have knowledge of the TestXPTCInvoke program,
nor the AIX platform to test on. 
                                                                                      
pkw@austin.ibm.com: if you don't mind, can you add a comment to this bug
verifying that this fixed the problem? Thanks - 
Status: RESOLVED → VERIFIED
It looks good from here.
Has this been checked into the 0.9.6 branch yet?
hrm, nevermind, it appears so.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: