From 65dcb15fb1f0351c8f5501b66d2899cd8669a4f7 Mon Sep 17 00:00:00 2001 From: Taylor Holliday Date: Sat, 23 Sep 2023 22:28:25 -0700 Subject: [PATCH] Update array_checker.rs --- src/array_checker.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/array_checker.rs b/src/array_checker.rs index 2913b09..be56b59 100644 --- a/src/array_checker.rs +++ b/src/array_checker.rs @@ -52,6 +52,19 @@ impl ArrayChecker { fn check_expr(&mut self, expr: ExprID, decl: &FuncDecl, decls: &DeclTable) -> IndexInterval { match &decl.arena[expr] { + Expr::Int(x) => { + IndexInterval { min: *x, max: *x } + } + Expr::Block(exprs) => { + let n = self.vars.len(); + for e in exprs { + self.check_expr(*e, decl, decls); + } + while self.vars.len() > n { + self.vars.pop(); + } + IndexInterval::default() + } Expr::Let(name, init, _) => { self.check_expr(*init, decl, decls); let ty = decl.types[expr];