Changeset 148062 in webkit
- Timestamp:
- Apr 9, 2013 4:28:59 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/APICast.h
r142557 r148062 68 68 if (!jsCell) 69 69 return JSC::jsNull(); 70 JSC::JSValue result; 70 71 if (jsCell->isAPIValueWrapper()) 71 return JSC::jsCast<JSC::JSAPIValueWrapper*>(jsCell)->value(); 72 return jsCell; 72 result = JSC::jsCast<JSC::JSAPIValueWrapper*>(jsCell)->value(); 73 else 74 result = jsCell; 73 75 #else 74 76 JSC::JSValue result = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(const_cast<OpaqueJSValue*>(v))); 77 #endif 75 78 if (!result) 76 79 return JSC::jsNull(); 80 if (result.isCell()) 81 RELEASE_ASSERT(result.asCell()->methodTable()); 77 82 return result; 78 #endif79 83 } 80 84 … … 86 90 if (!jsCell) 87 91 return JSC::JSValue(); 88 returnjsCell;92 JSC::JSValue result = jsCell; 89 93 #else 90 returnJSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(const_cast<OpaqueJSValue*>(v)));94 JSC::JSValue result = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(const_cast<OpaqueJSValue*>(v))); 91 95 #endif 96 if (result && result.isCell()) 97 RELEASE_ASSERT(result.asCell()->methodTable()); 98 return result; 92 99 } 93 100 94 101 inline JSC::JSObject* toJS(JSObjectRef o) 95 102 { 96 return reinterpret_cast<JSC::JSObject*>(o); 103 JSC::JSObject* object = reinterpret_cast<JSC::JSObject*>(o); 104 if (object) 105 RELEASE_ASSERT(object->methodTable()); 106 return object; 97 107 } 98 108 -
trunk/Source/JavaScriptCore/ChangeLog
r148045 r148062 1 2013-04-09 Oliver Hunt <oliver@apple.com> 2 3 Add liveness tests to JSC API entry points 4 https://bugs.webkit.org/show_bug.cgi?id=114318 5 6 Reviewed by Filip Pizlo. 7 8 Add simple checks for the existence of a method table on any 9 JSCells passed across the API. This in turn forces a structure 10 validity test. 11 12 * API/APICast.h: 13 (toJS): 14 (toJSForGC): 15 1 16 2013-04-09 Balazs Kilvady <kilvadyb@homejinni.com> 2 17
Note: See TracChangeset
for help on using the changeset viewer.