board_inspector: strip an end tag when concat resource templates
Resource template buffers always end with an end tag. Concatenation of two
resource buffers thus requires that the end tag of the first buffer is
stripped. This patch adds this logic to the interpretation of DefConcatRes
AML nodes.
@@ -432,7 +432,11 @@ class ConcreteInterpreter(Interpreter):
def DefConcatRes(self, tree):
data = bytearray()
source1 = self.interpret(tree.children[0])
- data.extend(source1.to_buffer().get())
+ buf = source1.to_buffer().get()
+ if len(buf) >= 2 and buf[-2] == 0x79:
+ data.extend(buf[:-2])
+ else:
+ data.extend(buf)
source2 = self.interpret(tree.children[1])
data.extend(source2.to_buffer().get())
result = Buffer(data)
