diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-04-17 19:35:02 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-04-17 19:35:02 -0700 |
commit | 1154db7a74f95ddf73d28070dea8d57d4bf4afdc (patch) | |
tree | 40c0741e0534be44f006f557b009bcf6b49e824d /shell | |
parent | 412ec38f30517fae6230b68ddcc970994a86a65b (diff) | |
download | mu-1154db7a74f95ddf73d28070dea8d57d4bf4afdc.tar.gz |
load sandbox even if there are no globals
Diffstat (limited to 'shell')
-rw-r--r-- | shell/main.mu | 20 |
1 files changed, 9 insertions, 11 deletions
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: |