board_inspector: fix returning nested local variables
Local variables can be assigned with formal arguments in AML. As a result
when interpreting a DefReturn node, the interpreter shall unwrap multiple
layers of argument/local variable wrappings until a concrete value is
found. This patch implements this logic.
@@ -357,7 +357,7 @@ class ConcreteInterpreter(Interpreter):
def DefReturn(self, tree):
obj = self.interpret(tree.children[0])
- if isinstance(obj, (self.Argument, self.LocalVariable)):
+ while isinstance(obj, (self.Argument, self.LocalVariable)):
obj = obj.get_obj()
self.stack[-1].return_value = obj
raise MethodReturn()
