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:
parent
0b46440b32
commit
503b1ee317
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue