wasm: fix QWasmString::toQString assertion for emscripten 1.39.4
In emscripten 1.39.4 `maxBytesToWrite` argument is required for function `stringToUTF16(str, outPtr, maxBytesToWrite)` Fixes: QTBUG-81728 Change-Id: I634134a30454ae09a9a05593428397b40464b31f Reviewed-by: jian liang <jianliang79@gmail.com> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
parent
287b570ad5
commit
f998e630e7
@ -52,9 +52,10 @@ QString QWasmString::toQString(const val &v)
|
||||
val::global("Module")["stringToUTF16"]);
|
||||
static const val length("length");
|
||||
|
||||
result.resize(v[length].as<int>());
|
||||
int len = v[length].as<int>();
|
||||
result.resize(len);
|
||||
auto ptr = quintptr(result.utf16());
|
||||
stringToUTF16(v, val(ptr));
|
||||
stringToUTF16(v, val(ptr), val((len + 1) * 2));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user