Showing the changes to libraries/script-engine/src/v8/ScriptEngineV8_cast.cpp (1 of 2 files). Show all
Unified · Split
| @@ -344,6 +344,8 @@ bool ScriptEngineV8::castValueToVariant(const V8ScriptValue& v8Val, QVariant& de · 343 unmodified lines | ||
| 344 | 344 | if (demarshalFunc) { |
| 345 | 345 | dest = QVariant(destTypeId, static_cast<void*>(NULL)); |
| 346 | 346 | ScriptValue wrappedVal(new ScriptValueV8Wrapper(this, v8Val)); |
| 347 | + Q_ASSERT(dest.constData() != nullptr); | |
| 348 | + //V8TODO: Data should never be written to dest.constData() according to Qt documentation. | |
| 347 | 349 | bool success = demarshalFunc(wrappedVal, const_cast<void*>(dest.constData())); |
| 348 | 350 | if(!success) dest = QVariant(); |
| 349 | 351 | return success; |
| @@ -689,6 +691,7 @@ V8ScriptValue ScriptEngineV8::castVariantToValue(const QVariant& val) { · 339 unmodified lines | ||
| 689 | 691 | _customTypeProtect.unlock(); |
| 690 | 692 | } |
| 691 | 693 | if (marshalFunc) { |
| 694 | + Q_ASSERT(val.constData() != nullptr); | |
| 692 | 695 | ScriptValue wrappedVal = marshalFunc(this, val.constData()); |
| 693 | 696 | return ScriptValueV8Wrapper::fullUnwrap(this, wrappedVal); |
| 694 | 697 | } |