Closed Bug 761473 Opened 12 years ago Closed 12 years ago

IonMonkey: Check & Fix usage of writeSlotHeader in Snapshots.cpp

Categories

(Core :: JavaScript Engine, defect)

Other Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: nbp, Assigned: nbp)

Details

(Whiteboard: [ion:p1:fx18])

Attachments

(1 file)

writeSlotHeader assert that each of its argument are under the maximal payload for each value.  Some usage of it are apparently not tested because the assertion does not hold with Register::Invalid.
Whiteboard: [ion:t → [ion:t]
This bug can be triggered by using many allocations such as we don't have enough registers to hold all the values.  When we don't have enough registers, we will fallback to

addSlot(JSValueType type, int32 stackIndex)
addSlot(int32 valueStackSlot)

which are using writeSlotHeader with Register::Invalid and FloatRegister::Invalid (UINT_MAX) instead of MAX_REG_FIELD_VALUE (31).  This should fail an assertion in debug builds and may cause the snapshot reader to read bad values in optimized builds.
Whiteboard: [ion:t] → [ion:p1:fx18]
Assignee: general → nicolas.b.pierron
Status: NEW → ASSIGNED
Attachment #654745 - Flags: review?(dvander) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.