Skip to content

Commit 69e1648

Browse files
martin-hughesIsaacWoods
authored andcommitted
Unwrap reference in do_size_of
1 parent d37640b commit 69e1648

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

src/aml/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2292,7 +2292,7 @@ where
22922292

22932293
fn do_size_of(&self, context: &mut MethodContext, op: OpInFlight) -> Result<(), AmlError> {
22942294
extract_args!(op => [Argument::Object(object)]);
2295-
let object = object.clone().unwrap_transparent_reference();
2295+
let object = object.clone().unwrap_reference();
22962296

22972297
let result = match *object {
22982298
Object::Buffer(ref buffer) => buffer.len(),

tests/package_sizeof.asl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
DefinitionBlock("", "DSDT", 1, "RSACPI", "PACKGE", 1) {
2+
// Checks fix for issue 282 - SizeOf on a reference to a package doesn't work.
3+
Name(FOO, Package (3) {
4+
Package (0x01) {
5+
0x1,
6+
},
7+
8+
Package (0x01) {
9+
0x02,
10+
},
11+
12+
Package (0x01) {
13+
0x03,
14+
}
15+
})
16+
17+
Method (MAIN, 0, NotSerialized) {
18+
Local0 = Sizeof (FOO)
19+
Local1 = Sizeof (FOO[0]) // This was what failed in issue 282.
20+
Return ((Local0 != 3) || (Local1 != 1))
21+
}
22+
}

0 commit comments

Comments
 (0)