From 1154db7a74f95ddf73d28070dea8d57d4bf4afdc Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 17 Apr 2021 19:35:02 -0700 Subject: load sandbox even if there are no globals --- shell/main.mu | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'shell') diff --git a/shell/main.mu b/shell/main.mu index 96aafbf5..6aecadbd 100644 --- a/shell/main.mu +++ b/shell/main.mu @@ -58,12 +58,11 @@ fn load-state data-disk: (addr disk), _sandbox: (addr sandbox), globals: (addr g var globals-cell-ah/edx: (addr handle cell) <- address globals-cell-storage lookup-symbol globals-literal, globals-cell-ah, *initial-root, 0/no-globals, 0/no-trace, 0/no-screen, 0/no-keyboard var globals-cell/eax: (addr cell) <- lookup *globals-cell-ah - compare globals-cell, 0 { - break-if-!= - return + compare globals-cell, 0 + break-if-= + load-globals globals-cell-ah, globals } - load-globals globals-cell-ah, globals # sandbox = assoc(initial-root, 'sandbox) var sandbox-literal-storage: (handle cell) var sandbox-literal-ah/eax: (addr handle cell) <- address sandbox-literal-storage @@ -73,15 +72,14 @@ fn load-state data-disk: (addr disk), _sandbox: (addr sandbox), globals: (addr g var sandbox-cell-ah/edx: (addr handle cell) <- address sandbox-cell-storage lookup-symbol sandbox-literal, sandbox-cell-ah, *initial-root, 0/no-globals, 0/no-trace, 0/no-screen, 0/no-keyboard var sandbox-cell/eax: (addr cell) <- lookup *sandbox-cell-ah - compare sandbox-cell, 0 { - break-if-!= - return + compare sandbox-cell, 0 + break-if-= + # print: cell -> stream + print-cell sandbox-cell-ah, s, 0/no-trace + # stream -> gap-buffer + load-gap-buffer-from-stream data, s } - # print: cell -> stream - print-cell sandbox-cell-ah, s, 0/no-trace - # stream -> gap-buffer - load-gap-buffer-from-stream data, s } # Save state as an alist of alists: -- cgit 1.4.1-2-gfad0