Skip to content

Commit 4e304db

Browse files
authored
fix: convert result of allocate_mappings from signed to unsigned (#473)
1 parent ef55f77 commit 4e304db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/source-map-consumer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,9 @@ class BasicSourceMapConsumer extends SourceMapConsumer {
301301
const aStr = this._mappings;
302302
const size = aStr.length;
303303

304-
const mappingsBufPtr = this._wasm.exports.allocate_mappings(size);
304+
// Interpret signed result of allocate_mappings as unsigned, otherwise
305+
// addresses higher than 2GB will be negative.
306+
const mappingsBufPtr = this._wasm.exports.allocate_mappings(size) >>> 0;
305307
const mappingsBuf = new Uint8Array(
306308
this._wasm.exports.memory.buffer,
307309
mappingsBufPtr,

0 commit comments

Comments
 (0)