diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-05-26 03:01:09 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-05-26 03:01:09 +0200 |
commit | 30e483b84a6b2b1761a04b177be98e8e9ebfbb58 (patch) | |
tree | 60ed38e659e23f93a04726c6073aa1dc02f949a8 | |
parent | 3bcf9d5876029d5efec590ab724b841fdf75c556 (diff) | |
parent | 9d1a907345d6a04178b93389803e2d17f090953a (diff) | |
download | qtscript-30e483b84a6b2b1761a04b177be98e8e9ebfbb58.tar.gz |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I26d9146145cff1290913ca60ca16a2fc244b50ef
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h index 501ab5e..7584c52 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h @@ -773,22 +773,30 @@ namespace JSC { // JSValue member functions. inline EncodedJSValue JSValue::encode(JSValue value) { - return reinterpret_cast<EncodedJSValue>(value.m_ptr); + EncodedJSValue r; + memcpy(&r, &value.m_ptr, sizeof(r)); + return r; } inline JSValue JSValue::decode(EncodedJSValue ptr) { - return JSValue(reinterpret_cast<JSCell*>(ptr)); + JSCell *cellPtr; + memcpy(&cellPtr, &ptr, sizeof(cellPtr)); + return JSValue(cellPtr); } inline JSValue JSValue::makeImmediate(intptr_t value) { - return JSValue(reinterpret_cast<JSCell*>(value)); + JSCell *cellPtr; + memcpy(&cellPtr, &value, sizeof(cellPtr)); + return JSValue(cellPtr); } inline intptr_t JSValue::immediateValue() { - return reinterpret_cast<intptr_t>(m_ptr); + intptr_t v; + memcpy(&v, &m_ptr, sizeof(v)); + return v; } // 0x0 can never occur naturally because it has a tag of 00, indicating a pointer value, but a payload of 0x0, which is in the (invalid) zero page. |