cc: fix load bug

This commit is contained in:
Paul Mathieu 2021-03-20 21:49:40 -07:00
parent a4005ade77
commit 6825ce464f

View File

@ -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: