diff options
Diffstat (limited to 'source/compiler/aslfiles.c')
-rw-r--r-- | source/compiler/aslfiles.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/source/compiler/aslfiles.c b/source/compiler/aslfiles.c index b9208c7c4492..dba05d35d33a 100644 --- a/source/compiler/aslfiles.c +++ b/source/compiler/aslfiles.c @@ -207,12 +207,6 @@ FlInitOneFile ( NewFileNode = ACPI_CAST_PTR (ASL_GLOBAL_FILE_NODE, UtLocalCacheCalloc (sizeof (ASL_GLOBAL_FILE_NODE))); - if (!NewFileNode) - { - AslError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION, NULL, NULL); - return (AE_NO_MEMORY); - } - NewFileNode->ParserErrorDetected = FALSE; NewFileNode->Next = AslGbl_FilesList; @@ -420,8 +414,22 @@ ASL_GLOBAL_FILE_NODE * FlGetCurrentFileNode ( void) { - return (FlGetFileNode ( - ASL_FILE_INPUT,AslGbl_Files[ASL_FILE_INPUT].Filename)); + ASL_GLOBAL_FILE_NODE *FileNode = + FlGetFileNode (ASL_FILE_INPUT,AslGbl_Files[ASL_FILE_INPUT].Filename); + + + if (!FileNode) + { + /* + * If the current file node does not exist after initializing the file + * node structures, something went wrong and this is an unrecoverable + * condition. + */ + FlFileError (ASL_FILE_INPUT, ASL_MSG_COMPILER_INTERNAL); + AslAbort (); + } + + return (FileNode); } |