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: