Blob Blame History Raw
ASL Test Suite encounters the following type of error...

  Table [DSDT] is too long for file - needs: 0xCE4C0000, remaining in file: 0x4CCE

when tests/aslts.sh was run on a big-endian system.

diff --git a/source/common/acfileio.c b/source/common/acfileio.c
index 589eaea..83e59e2 100644
--- a/source/common/acfileio.c
+++ b/source/common/acfileio.c
@@ -391,6 +391,7 @@ AcValidateTableHeader (
     size_t                  Actual;
     long                    OriginalOffset;
     UINT32                  FileSize;
+    UINT32                  Length;
     UINT32                  i;
 
 
@@ -422,11 +423,12 @@ AcValidateTableHeader (
     /* Validate table length against bytes remaining in the file */
 
     FileSize = CmGetFileSize (File);
-    if (TableHeader.Length > (UINT32) (FileSize - TableOffset))
+    ACPI_MOVE_32_TO_32(&Length, &TableHeader.Length);
+    if (Length > (UINT32) (FileSize - TableOffset))
     {
         fprintf (stderr, "Table [%4.4s] is too long for file - "
             "needs: 0x%.2X, remaining in file: 0x%.2X\n",
-            TableHeader.Signature, TableHeader.Length,
+            TableHeader.Signature, Length,
             (UINT32) (FileSize - TableOffset));
         return (AE_BAD_HEADER);
     }