From 6825ce464f58dfaeffb4872fa3b0ec78e8c1fbd5 Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Sat, 20 Mar 2021 21:49:40 -0700 Subject: [PATCH] cc: fix load bug --- tools/cc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cc.py b/tools/cc.py index 989344c..9f9ec4f 100644 --- a/tools/cc.py +++ b/tools/cc.py @@ -892,7 +892,7 @@ class CcInterp(lark.visitors.Interpreter): s = self._lookup_symbol(ident) assert s is not None, f'unknown identifier {ident}' if isinstance(s, FunctionSpec) or ident in self.global_scope.symbols: - reg = reg or self._get_reg() + reg = self.cur_fun.regs.take(reg=reg, orwhatever=True) return SetAddr(self.cur_fun, [reg, ident]) else: if s.type.volatile: