Closed Bug 637233 Opened 13 years ago Closed 13 years ago

Android's VMPI atomic-integer operations return bad post-inc/dec values

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: siwilkin, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

Android's atomic-integer API returns pre-inc/dec values, whereas VMPI returns post-inc/dec values. This patch fixes VMPI's (trivial) conversion which is currently incorrect.
Attached patch Initial Patch. MQ rev 248 (obsolete) — Splinter Review
Attachment #515548 - Flags: superreview?(edwsmith)
Attachment #515548 - Flags: review?(kpalacz)
Blocks: 575544
Attachment #515548 - Attachment is obsolete: true
Attachment #515548 - Flags: superreview?(edwsmith)
Attachment #515548 - Flags: review?(kpalacz)
Attachment #515551 - Flags: review?(kpalacz)
Attachment #515551 - Flags: review?(fklockii)
Attachment #515551 - Flags: review?(fklockii) → review+
changeset: 6009:b8166dce7f69
user:      Simon Wilkinson <siwilkin>
summary:   Bug 637233: Fixes return values for Android atomic-inc/dec-and-get (r=fklockii, r pending kpalacz)

http://hg.mozilla.org/tamarin-redux/rev/b8166dce7f69
Attachment #515551 - Flags: superreview?(edwsmith)
Attachment #515551 - Flags: review?(kpalacz)
Attachment #515551 - Flags: review+
I think my comment on bug 629435 actually applies here, not there.. copied:

> I see that VMPI_atomicIncAndGet32WithBarrier() is being called in a loop to
> make sure the right number of increments happen, in ST_vmpi_threads.st.  But
> the test doesn't check the exact correctness of the returned value (before or
> after value)
> each time.
> 
> worth adding more tests?
Attachment #515551 - Flags: superreview?(edwsmith) → superreview+
(In reply to comment #4)
> I think my comment on bug 629435 actually applies here, not there.. copied:
> 
> > I see that VMPI_atomicIncAndGet32WithBarrier() is being called in a loop to
> > make sure the right number of increments happen, in ST_vmpi_threads.st.  But
> > the test doesn't check the exact correctness of the returned value (before or
> > after value)
> > each time.
> > 
> > worth adding more tests?

Seeing as though I messed it up so royally the first time around, it's probably worth adding a selftest.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: