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.

Tracked-On: #6287
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Junjie Mao 2021-07-27 14:57:00 +08:00 committed by wenlingz
parent 0b46440b32
commit 503b1ee317
1 changed files with 1 additions and 1 deletions

View File

@ -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()