Changeset 244057 in webkit
- Timestamp:
- Apr 8, 2019, 4:33:05 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/to-index-string-should-not-assume-incoming-value-is-uint32.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/runtime/CommonSlowPaths.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r244049 r244057 1 2019-04-08 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] to_index_string should not assume incoming value is Uint32 4 https://bugs.webkit.org/show_bug.cgi?id=196713 5 6 Reviewed by Saam Barati. 7 8 * stress/to-index-string-should-not-assume-incoming-value-is-uint32.js: Added. 9 (foo): 10 1 11 2019-04-08 Yusuke Suzuki <ysuzuki@apple.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r244050 r244057 1 2019-04-08 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] to_index_string should not assume incoming value is Uint32 4 https://bugs.webkit.org/show_bug.cgi?id=196713 5 6 Reviewed by Saam Barati. 7 8 The slow path of to_index_string assumes that incoming value is Uint32. But we should not have 9 this assumption since DFG may decide we should have it double format. This patch removes this 10 assumption, and instead, we should assume that incoming value is AnyInt and the range of this 11 is within Uint32. 12 13 * runtime/CommonSlowPaths.cpp: 14 (JSC::SLOW_PATH_DECL): 15 1 16 2019-04-08 Justin Fan <justin_fan@apple.com> 2 17 -
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
r243280 r244057 996 996 BEGIN(); 997 997 auto bytecode = pc->as<OpToIndexString>(); 998 RETURN(jsString(exec, Identifier::from(exec, GET(bytecode.m_index).jsValue().asUInt32()).string())); 998 JSValue indexValue = GET(bytecode.m_index).jsValue(); 999 ASSERT(indexValue.isAnyInt()); 1000 ASSERT(indexValue.asAnyInt() <= UINT32_MAX); 1001 ASSERT(indexValue.asAnyInt() >= 0); 1002 uint32_t index = static_cast<uint32_t>(indexValue.asAnyInt()); 1003 RETURN(jsString(exec, Identifier::from(exec, index).string())); 999 1004 } 1000 1005
Note:
See TracChangeset
for help on using the changeset viewer.