Inform - Support - Patches

About Patches  

Compiler  
Library  

DM4 Errata  

Issue C63002     [previous patch]

Story file not deleted after failed compilation
Submitted by: Sophie Frühling     Appeared in: Compiler 6.30 or before     Fixed in: -
Problem

If I call a routine that doesn't exist in my source code, Inform correctly reports the error, but still produces a story file (in an intermediate state). Running that story then crashes the interpreter with an "illegal opcode" runtime error. Example:

  [ Main; Crash(); ];
Solution (by Cedric Knight)

The simplest thing is to delete the file if an error has occurred during backpatching.

diff -u inform630ref\files.c .\files.c
--- inform630ref\files.c	Fri Feb 27 06:30:00 2004
+++ .\files.c	Sun Mar 14 23:52:36 2004
@@ -437,6 +437,7 @@
       fatalerror("I/O failure: couldn't backtrack on story file for checksum");

     fclose(sf_handle);
+    if (no_errors>0) remove(new_name);

     /*  Write a copy of the header into the debugging information file
         (mainly so that it can be used to identify which story file matches
@@ -853,6 +854,7 @@
       fatalerror("I/O failure: couldn't backtrack on story file for checksum");

     fclose(sf_handle);
+    if (no_errors>0) remove(new_name);

 #ifdef ARCHIMEDES
     {   char settype_command[PATHLEN];
diff -u inform630ref\inform.c .\inform.c
--- inform630ref\inform.c	Fri Feb 27 06:30:00 2004
+++ .\inform.c	Sun Mar 14 23:22:02 2004
@@ -1012,7 +1012,9 @@
         close_transcript_file();
     }

-    if (no_errors==0) { output_file(); output_has_occurred = TRUE; }
+    if (no_errors==0) output_file();
+
+    if (no_errors==0) { output_has_occurred = TRUE; }
     else { output_has_occurred = FALSE; }

     if (debugfile_switch) close_debug_file();


Last updated 17 April 2013. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Roger Firth.