summaryrefslogtreecommitdiff
path: root/source/compiler/aslcompile.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2013-06-26 19:01:10 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2013-06-26 19:01:10 +0000
commit94c37fb2483cc09856a30e74879a69f2ccfe22f0 (patch)
tree274ff6113dbdc6cbbbf50dc30d0527fb9cb0fc55 /source/compiler/aslcompile.c
parentb7f987c19dad2c6d33c64e7f96a9b4deca9e2650 (diff)
Notes
Diffstat (limited to 'source/compiler/aslcompile.c')
-rw-r--r--source/compiler/aslcompile.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/compiler/aslcompile.c b/source/compiler/aslcompile.c
index bbd8ab95ca05..87f97efaad7a 100644
--- a/source/compiler/aslcompile.c
+++ b/source/compiler/aslcompile.c
@@ -966,7 +966,19 @@ CmCleanupAndExit (
/* Close all open files */
- Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */
+ /*
+ * Take care with the preprocessor file (.i), it might be the same
+ * as the "input" file, depending on where the compiler has terminated
+ * or aborted. Prevent attempt to close the same file twice in
+ * loop below.
+ */
+ if (Gbl_Files[ASL_FILE_PREPROCESSOR].Handle ==
+ Gbl_Files[ASL_FILE_INPUT].Handle)
+ {
+ Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL;
+ }
+
+ /* Close the standard I/O files */
for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++)
{