Changeset 33566 in webkit
- Timestamp:
- May 18, 2008 5:36:04 PM (16 years ago)
- Location:
- branches/squirrelfish
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/squirrelfish/JavaScriptCore/ChangeLog
r33563 r33566 1 2008-05-18 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Maciej. 4 5 Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm 6 <https://bugs.webkit.org/show_bug.cgi?id=18752> 7 8 Handle exceptions thrown by toString conversion in subscript operators, 9 this should basically complete exception handling in SquirrelFish. 10 11 Sunspider reports no regression. 12 13 * VM/Machine.cpp: 14 (KJS::Machine::privateExecute): 15 1 16 2008-05-17 Geoffrey Garen <ggaren@apple.com> 2 17 -
branches/squirrelfish/JavaScriptCore/VM/Machine.cpp
r33563 r33566 1387 1387 if (propName->getUInt32(i)) 1388 1388 r[dst].u.jsValue = jsBoolean(baseObj->hasProperty(exec, i)); 1389 else 1390 r[dst].u.jsValue = jsBoolean(baseObj->hasProperty(exec, Identifier(propName->toString(exec)))); 1389 else { 1390 Identifier property(propName->toString(exec)); 1391 VM_CHECK_EXCEPTION(); 1392 r[dst].u.jsValue = jsBoolean(baseObj->hasProperty(exec, property)); 1393 } 1391 1394 1392 1395 ++vPC; … … 1548 1551 result = baseObj->get(exec, i); 1549 1552 else { 1550 VM_CHECK_EXCEPTION(); // If toObject threw, we must not call toString, which may execute arbitrary code 1551 result = baseObj->get(exec, Identifier(subscript->toString(exec))); 1553 Identifier property; 1554 if (subscript->isObject()) { 1555 VM_CHECK_EXCEPTION(); // If toObject threw, we must not call toString, which may execute arbitrary code 1556 property = Identifier(subscript->toString(exec)); 1557 } else 1558 property = Identifier(subscript->toString(exec)); 1559 1560 VM_CHECK_EXCEPTION(); // This check is needed to prevent us from incorrectly calling a getter after an exception is thrown 1561 result = baseObj->get(exec, property); 1552 1562 } 1553 1563 … … 1580 1590 baseObj->put(exec, i, r[value].u.jsValue); 1581 1591 else { 1582 VM_CHECK_EXCEPTION(); // If toObject threw, we must not call toString, which may execute arbitrary code 1583 baseObj->put(exec, Identifier(subscript->toString(exec)), r[value].u.jsValue); 1592 Identifier property; 1593 if (subscript->isObject()) { 1594 VM_CHECK_EXCEPTION(); // If toObject threw, we must not call toString, which may execute arbitrary code 1595 property = Identifier(subscript->toString(exec)); 1596 } else 1597 property = Identifier(subscript->toString(exec)); 1598 1599 VM_CHECK_EXCEPTION(); // This check is needed to prevent us from incorrectly calling a setter after an exception is thrown 1600 baseObj->put(exec, property, r[value].u.jsValue); 1584 1601 } 1585 1602 … … 1609 1626 else { 1610 1627 VM_CHECK_EXCEPTION(); // If toObject threw, we must not call toString, which may execute arbitrary code 1611 result = jsBoolean(baseObj->deleteProperty(exec, Identifier(subscript->toString(exec)))); 1628 Identifier property(subscript->toString(exec)); 1629 VM_CHECK_EXCEPTION(); 1630 result = jsBoolean(baseObj->deleteProperty(exec, property)); 1612 1631 } 1613 1632 -
branches/squirrelfish/LayoutTests/ChangeLog
r33562 r33566 1 2008-05-18 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Maciej. 4 5 Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm 6 <https://bugs.webkit.org/show_bug.cgi?id=18752> 7 8 Test cases for subscript access that throw exceptions. 9 10 * fast/js/resources/tostring-exception-in-property-access.js: Added. 11 * fast/js/tostring-exception-in-property-access-expected.txt: Added. 12 * fast/js/tostring-exception-in-property-access.html: Added. 13 1 14 2008-05-17 Cameron Zwarich <cwzwarich@uwaterloo.ca> 2 15
Note: See TracChangeset
for help on using the changeset viewer.