From c817d3edce32d6fa55475f2de3ee46135008a3b3 Mon Sep 17 00:00:00 2001 From: Kei Imada <> Date: Sun, 29 Oct 2023 16:10:59 -0400 Subject: [PATCH] Add return code support to brili --- brili.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/brili.ts b/brili.ts index 348b36f6c..ff9889d0a 100644 --- a/brili.ts +++ b/brili.ts @@ -941,7 +941,7 @@ function evalProg(prog: bril.Program) { curlabel: null, specparent: null, } - evalFunc(main, state); + let retVal = evalFunc(main, state); if (!heap.isEmpty()) { throw error(`Some memory locations have not been freed by end of execution.`); @@ -951,6 +951,7 @@ function evalProg(prog: bril.Program) { console.error(`total_dyn_inst: ${state.icount}`); } + Deno.exit(Number(retVal)); } async function main() {