Fix bug backing out of fasdump when an environment object is
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sun, 3 Apr 1988 18:13:26 +0000 (18:13 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sun, 3 Apr 1988 18:13:26 +0000 (18:13 +0000)
encountered.

v7/src/microcode/fasdump.c
v7/src/microcode/version.h
v8/src/microcode/version.h

index 6d3e6b2feeb339b7d303a0b1288c682a561738ee..bb4446842c95624435bf7fab60218520f67503a1 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fasdump.c,v 9.37 1988/03/21 21:15:48 jinx Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fasdump.c,v 9.38 1988/04/03 18:12:58 jinx Rel $
 
    This file contains code for fasdump and dump-band.
 */
@@ -84,11 +84,11 @@ static Boolean compiled_code_present_p;
    contents (e) To_Pointer is now NewFree.
 */
 
-#define Setup_Pointer_for_Dump(Extra_Code)                     \
+#define Setup_Pointer_for_Dump(Extra_Code)                             \
 Dump_Pointer(Fasdump_Setup_Pointer(Extra_Code, Normal_BH(false, continue)))
 
-#define Dump_Pointer(Code)                                     \
-Old = Get_Pointer(Temp);                                       \
+#define Dump_Pointer(Code)                                             \
+Old = Get_Pointer(Temp);                                               \
 Code
 
 #define Dump_Compiled_Entry()                                          \
@@ -115,6 +115,7 @@ DumpLoop(Scan, Dump_Mode)
      int Dump_Mode;
 {
   fast Pointer *To, *Old, Temp, New_Address, *Fixes;
+  long result;
 
   To = NewFree;
   Fixes = Fixup;
@@ -149,9 +150,35 @@ DumpLoop(Scan, Dump_Mode)
       case TC_STACK_ENVIRONMENT:
       case_Fasload_Non_Pointer:
        break;
-\f
+
       /* Compiled code relocation. */
 
+      case_compiled_entry_point:
+       compiled_code_present_p = true;
+       Dump_Compiled_Entry();
+       break;
+
+      case TC_MANIFEST_CLOSURE:
+      {
+       machine_word *start_ptr;
+       fast machine_word *word_ptr;
+
+       compiled_code_present_p = true;
+       Scan += 1;
+       word_ptr = FIRST_MANIFEST_CLOSURE_ENTRY(Scan);
+       start_ptr = word_ptr;
+
+       while (VALID_MANIFEST_CLOSURE_ENTRY(word_ptr))
+       {
+         Scan = MANIFEST_CLOSURE_ENTRY_ADDRESS(word_ptr);
+         word_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
+         Temp = *Scan;
+         Dump_Compiled_Entry();
+       }
+       Scan = MANIFEST_CLOSURE_END(word_ptr, start_ptr);
+       break;
+      }
+\f
       case TC_LINKAGE_SECTION:
       {
        compiled_code_present_p = true;
@@ -195,31 +222,6 @@ DumpLoop(Scan, Dump_Mode)
          break;
        }
       }
-\f
-      case TC_MANIFEST_CLOSURE:
-      {
-       machine_word *start_ptr;
-       fast machine_word *word_ptr;
-
-       Scan += 1;
-       word_ptr = FIRST_MANIFEST_CLOSURE_ENTRY(Scan);
-       start_ptr = word_ptr;
-
-       while (VALID_MANIFEST_CLOSURE_ENTRY(word_ptr))
-       {
-         Scan = MANIFEST_CLOSURE_ENTRY_ADDRESS(word_ptr);
-         word_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
-         Temp = *Scan;
-         Dump_Compiled_Entry();
-       }
-       Scan = MANIFEST_CLOSURE_END(word_ptr, start_ptr);
-       break;
-      }
-
-      case_compiled_entry_point:
-       compiled_code_present_p = true;
-       Dump_Compiled_Entry();
-       break;
 \f
       case_Cell:
        Setup_Pointer_for_Dump(Transport_Cell());
@@ -253,11 +255,7 @@ DumpLoop(Scan, Dump_Mode)
       case TC_VARIABLE:
        Setup_Pointer_for_Dump(Fasdump_Variable());
        break;
-
-/* DumpLoop continues on the next page */
 \f
-/* DumpLoop, continued */
-
       case_Quadruple:
        Setup_Pointer_for_Dump(Transport_Quadruple());
        break;
@@ -275,7 +273,8 @@ DumpLoop(Scan, Dump_Mode)
 
       case TC_ENVIRONMENT:
        /* Make fasdump fail */
-       return (ERR_FASDUMP_ENVIRONMENT);
+       result = ERR_FASDUMP_ENVIRONMENT;
+       goto exit_dumploop;
 
       case TC_FUTURE:
        Setup_Pointer_for_Dump(Transport_Future());
@@ -290,9 +289,12 @@ DumpLoop(Scan, Dump_Mode)
        /*NOTREACHED*/
       }
   }
+  result = PRIM_DONE;
+
+exit_dumploop:
   NewFree = To;
   Fixup = Fixes;
-  return (PRIM_DONE);
+  return (result);
 }
 \f
 #define DUMPLOOP(obj, code)                                            \
@@ -452,9 +454,9 @@ DEFINE_PRIMITIVE("PRIMITIVE-FASDUMP", Prim_Prim_Fasdump, 3)
                        ((long) (table_end - table_start)),
                        compiled_code_present_p, false);
   }
-\f
   else
 #endif /* Dumping for reload into heap */
+\f
   {
     DUMPLOOP(New_Object, NORMAL_GC);
 #if false
@@ -476,8 +478,6 @@ DEFINE_PRIMITIVE("PRIMITIVE-FASDUMP", Prim_Prim_Fasdump, 3)
                        compiled_code_present_p, false);
   }
 
-  /* The and is short-circuit, so it must be done in this order. */
-
   PRIMITIVE_RETURN(Fasdump_Exit(result ? PRIM_DONE : PRIM_INTERRUPT));
 }
 \f
index d5e34b8de22adf8fc381ad17760a03fc808d1c7c..6cb8e6b943311e7af0f008bb6f30209965300897 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.30 1988/03/24 07:13:46 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.31 1988/04/03 18:13:26 jinx Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                10
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     30
+#define SUBVERSION     31
 #endif
 
 #ifndef UCODE_TABLES_FILENAME
index 4397a7543fa80dda0aade5b5164e21bc75455763..429b6c292d1407e4893f790e37ced73a1dcbdc87 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 10.30 1988/03/24 07:13:46 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 10.31 1988/04/03 18:13:26 jinx Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                10
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     30
+#define SUBVERSION     31
 #endif
 
 #ifndef UCODE_TABLES_FILENAME