Closed Bug 570214 Opened 15 years ago Closed 14 years ago

MIPS variable shift instructions corrupts registers

Categories

(Core Graveyard :: Nanojit, defect)

Other
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: chris, Assigned: wmaddox)

Details

(Whiteboard: fixed-in-nanojit, fixed-in-tracemonkey, fixed-in-tamarin)

Attachments

(1 file, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100402 Ubuntu/9.10 (karmic) Firefox/3.5.9 Build Identifier: The MIPS backend masks the shift amount before using it for a shift. This is both unnecessary and can corrupt a register that may still be in use. Reproducible: Always Steps to Reproduce: Shows up in the random testcase as a segmentation fault: -sh-4.0# bin/lirasm --execute --random 100000 --optimize Segmentation fault
Tested in nanojit-central and tamarin-redux
patch -> new
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #449339 - Flags: review?(edwsmith)
Attachment #449339 - Flags: review?(edwsmith) → review+
Comment on attachment 449339 [details] [diff] [review] Removes unnecessary mask in variable shift opcodes I do see how the code could corrupt a register, and how the patch won't do that anymore. I have to take it on faith that the MIPS shift instructions only consider the low order 5 bits of the shift amount.
(In reply to comment #3) > I have to take it on faith that the MIPS shift instructions only > consider the low order 5 bits of the shift amount. That's correct. The variable shift instructions only use the bottom 5 bits of the shift amount register.
(In reply to comment #4) > That's correct. The variable shift instructions only use the bottom 5 bits of > the shift amount register. Perhaps we should capture that in comments in the source, to prevent someone trying to helpfully re-add masking in the future.
Added comments to make it clear that no additional masking of the shift amount is required as it is handled by the individual instructions.
Attachment #449339 - Attachment is obsolete: true
Attachment #449657 - Flags: review?(stejohns)
Attachment #449657 - Flags: review?(stejohns) → review+
Assignee: nobody → wmaddox
Whiteboard: fixed-in-nanojit
Status: NEW → ASSIGNED
Whiteboard: fixed-in-nanojit → fixed-in-nanojit, fixed-in-tracemonkey
Whiteboard: fixed-in-nanojit, fixed-in-tracemonkey → fixed-in-nanojit, fixed-in-tracemonkey, fixed-in-tamarin
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: