Changeset 34945 in webkit for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- Jul 1, 2008, 10:39:23 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r34943 r34945 1839 1839 result = baseValue->get(exec, i); 1840 1840 else { 1841 JSObject* baseObj = baseValue->toObject(exec); // may throw 1842 1843 Identifier property; 1844 if (subscript->isObject()) { 1845 VM_CHECK_EXCEPTION(); // If toObject threw, we must not call toString, which may execute arbitrary code 1846 property = Identifier(exec, subscript->toString(exec)); 1847 } else 1848 property = Identifier(exec, subscript->toString(exec)); 1849 1850 VM_CHECK_EXCEPTION(); // This check is needed to prevent us from incorrectly calling a getter after an exception is thrown 1851 result = baseObj->get(exec, property); 1841 Identifier property(exec, subscript->toString(exec)); 1842 result = baseValue->get(exec, property); 1852 1843 } 1853 1844 … … 1881 1872 baseValue->put(exec, i, r[value].u.jsValue); 1882 1873 else { 1883 JSObject* baseObj = baseValue->toObject(exec); 1884 1885 Identifier property; 1886 if (subscript->isObject()) { 1887 VM_CHECK_EXCEPTION(); // If toObject threw, we must not call toString, which may execute arbitrary code 1888 property = Identifier(exec, subscript->toString(exec)); 1889 } else 1890 property = Identifier(exec, subscript->toString(exec)); 1891 1892 VM_CHECK_EXCEPTION(); // This check is needed to prevent us from incorrectly calling a setter after an exception is thrown 1893 baseObj->put(exec, property, r[value].u.jsValue); 1874 Identifier property(exec, subscript->toString(exec)); 1875 if (!exec->hadException()) // Don't put to an object if toString threw an exception. 1876 baseValue->put(exec, property, r[value].u.jsValue); 1894 1877 } 1895 1878 … … 1918 1901 result = jsBoolean(baseObj->deleteProperty(exec, i)); 1919 1902 else { 1920 VM_CHECK_EXCEPTION(); // If toObject threw, we must not call toString, which may execute arbitrary code1903 VM_CHECK_EXCEPTION(); 1921 1904 Identifier property(exec, subscript->toString(exec)); 1922 1905 VM_CHECK_EXCEPTION();
Note:
See TracChangeset
for help on using the changeset viewer.