Skip to content

Commit 848bb4a

Browse files
committed
fix for objects with zero data length at the end of global heap
1 parent 980f67e commit 848bb4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

esm/misc-low-level.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export class GlobalHeap {
145145
if (this._objects == null) {
146146
this._objects = new Map();
147147
var offset = 0;
148-
while (offset < this.heap_data.byteLength) {
148+
while (offset <= this.heap_data.byteLength - GLOBAL_HEAP_OBJECT_SIZE) {
149149
let info = _unpack_struct_from(
150150
GLOBAL_HEAP_OBJECT, this.heap_data, offset);
151151
if (info.get('object_index') == 0) {

0 commit comments

Comments
 (0)