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
624624 package_contents. push ( value) ;
625625 }
626626
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 {
628631 return Err ( ( input, context, Propagate :: Err ( AmlError :: MalformedPackage ) ) ) ;
629632 }
630633
634+ package_contents. resize ( num_elements as usize , AmlValue :: Uninitialized ) ;
635+
631636 Ok ( ( input, context, AmlValue :: Package ( package_contents) ) )
632637 }
633638 } ) ,
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ impl fmt::Debug for MethodCode {
174174
175175#[ derive( Clone , Debug ) ]
176176pub enum AmlValue {
177+ Uninitialized ,
177178 Boolean ( bool ) ,
178179 Integer ( u64 ) ,
179180 String ( String ) ,
@@ -246,6 +247,7 @@ impl AmlValue {
246247
247248 pub fn type_of ( & self ) -> AmlType {
248249 match self {
250+ AmlValue :: Uninitialized => AmlType :: Uninitialized ,
249251 AmlValue :: Boolean ( _) => AmlType :: Integer ,
250252 AmlValue :: Integer ( _) => AmlType :: Integer ,
251253 AmlValue :: String ( _) => AmlType :: String ,
You can’t perform that action at this time.
0 commit comments