File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -624,10 +624,15 @@ where
624
624
package_contents. push ( value) ;
625
625
}
626
626
627
- if package_contents. len ( ) != num_elements as usize {
627
+ // ACPI6.2, §19.6.101 specifies that if NumElements is present and is greater
628
+ // than the number of entries in the PackageList, the default entry of type
629
+ // Uninitialized is used
630
+ if package_contents. len ( ) > num_elements as usize {
628
631
return Err ( ( input, context, Propagate :: Err ( AmlError :: MalformedPackage ) ) ) ;
629
632
}
630
633
634
+ package_contents. resize ( num_elements as usize , AmlValue :: Uninitialized ) ;
635
+
631
636
Ok ( ( input, context, AmlValue :: Package ( package_contents) ) )
632
637
}
633
638
} ) ,
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ impl fmt::Debug for MethodCode {
174
174
175
175
#[ derive( Clone , Debug ) ]
176
176
pub enum AmlValue {
177
+ Uninitialized ,
177
178
Boolean ( bool ) ,
178
179
Integer ( u64 ) ,
179
180
String ( String ) ,
@@ -246,6 +247,7 @@ impl AmlValue {
246
247
247
248
pub fn type_of ( & self ) -> AmlType {
248
249
match self {
250
+ AmlValue :: Uninitialized => AmlType :: Uninitialized ,
249
251
AmlValue :: Boolean ( _) => AmlType :: Integer ,
250
252
AmlValue :: Integer ( _) => AmlType :: Integer ,
251
253
AmlValue :: String ( _) => AmlType :: String ,
You can’t perform that action at this time.
0 commit comments