mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
chore (wasi): wasm bigint issue
ecmscripten has this flag "-sWASM_BIGINT=1" which make functions like fd_pread and seek to have different signature where the uint64 offset are represented as offset_lo and offset_hi. With this flag, the offset become of type BigInt
This commit is contained in:
parent
e63ff46c6d
commit
c7c7113f52
1 changed files with 2 additions and 2 deletions
|
|
@ -291,14 +291,14 @@ export class Wasi {
|
|||
return 0;
|
||||
}
|
||||
|
||||
fd_pread(fd, iovs, iovs_len, offset64, nread) {
|
||||
fd_pread(fd, iovs, iovs_len, offset_lo, offset_hi, nread) {
|
||||
const file = FS[fd];
|
||||
if (!file) {
|
||||
console.error(`Invalid fd: ${fd}`);
|
||||
return -1;
|
||||
}
|
||||
|
||||
const start = Number(offset64);
|
||||
const start = (offset_hi >>> 0) * 0x100000000 + (offset_lo >>> 0);
|
||||
const ioVec = new Uint32Array(this.#instance.exports.memory.buffer, iovs, iovs_len * 2);
|
||||
const mem = new Uint8Array(this.#instance.exports.memory.buffer);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue