From 503b1ee31701a5f861eb7c5070ad3dba2eea22a2 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Tue, 27 Jul 2021 14:57:00 +0800 Subject: [PATCH] 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 --- misc/config_tools/board_inspector/acpiparser/aml/interpreter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/config_tools/board_inspector/acpiparser/aml/interpreter.py b/misc/config_tools/board_inspector/acpiparser/aml/interpreter.py index 3f69dabb0..4238ac477 100644 --- a/misc/config_tools/board_inspector/acpiparser/aml/interpreter.py +++ b/misc/config_tools/board_inspector/acpiparser/aml/interpreter.py @@ -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()