Changeset 278660 in webkit
- Timestamp:
- Jun 9, 2021, 8:21:39 AM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r278656 r278660 1 2021-06-09 Mikhail R. Gadelha <mikhail@igalia.com> 2 3 Fix inadvertent tag corruption in functionAddressOf 4 https://bugs.webkit.org/show_bug.cgi?id=226503 5 6 Reviewed by Darin Adler. 7 8 Original patch by Angelos Oikonomopoulos. 9 10 The cast was sign-extending the JSValue address in 32 bits, so that addresses 11 that had the most significant set gave us a sign-extended result in 12 asNumber which was then converted to an invalid NaN by the bitcast. 13 14 Instead, cast the address to uintptr_t, and the result will be promoted 15 uint64_t without sign-extending the address. 16 17 * jsc.cpp: 18 (JSC_DEFINE_HOST_FUNCTION): 19 1 20 2021-06-08 Yusuke Suzuki <ysuzuki@apple.com> 2 21 -
trunk/Source/JavaScriptCore/jsc.cpp
r278516 r278660 1481 1481 return JSValue::encode(jsUndefined()); 1482 1482 // Need to cast to uint64_t so bitwise_cast will play along. 1483 uint64_t asNumber = reinterpret_cast<uint 64_t>(value.asCell());1483 uint64_t asNumber = reinterpret_cast<uintptr_t>(value.asCell()); 1484 1484 EncodedJSValue returnValue = JSValue::encode(jsNumber(bitwise_cast<double>(asNumber))); 1485 1485 return returnValue;
Note:
See TracChangeset
for help on using the changeset viewer.