Skip to content

Commit 45e6532

Browse files
authored
Fix stacked memory snapshot generation (#5204)
We need to include the soMemoryBases and loadOrder from the original memory snapshot.
1 parent 8ac35e2 commit 45e6532

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/pyodide/internal/snapshot.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ const CREATED_SNAPSHOT_META: DsoLoadInfo = {
106106
soMemoryBases: {},
107107
loadOrder: [],
108108
};
109+
if (LOADED_SNAPSHOT_META) {
110+
Object.assign(
111+
CREATED_SNAPSHOT_META.soMemoryBases,
112+
LOADED_SNAPSHOT_META.soMemoryBases
113+
);
114+
CREATED_SNAPSHOT_META.loadOrder.push(...LOADED_SNAPSHOT_META.loadOrder);
115+
}
109116
export const LOADED_SNAPSHOT_TYPE = LOADED_SNAPSHOT_META?.settings.snapshotType;
110117

111118
/**

0 commit comments

Comments
 (0)