]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix save-image-and-exit bug
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 19 Sep 2008 19:44:58 +0000 (14:44 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 19 Sep 2008 19:44:58 +0000 (14:44 -0500)
core/memory/memory-tests.factor
vm/image.c

index 9fded3eb3a6bafc45a81a5008a0c3cf4a50b4c6c..1c23e700ca0c661a89615faff135c41335bb15ab 100755 (executable)
@@ -1,4 +1,4 @@
-USING: generic kernel kernel.private math memory prettyprint
+USING: generic kernel kernel.private math memory prettyprint io
 sequences tools.test words namespaces layouts classes
 classes.builtin arrays quotations ;
 IN: memory.tests
@@ -19,6 +19,7 @@ TUPLE: testing x y z ;
 [ ] [
     num-types get [
         type>class [
+            dup . flush
             "predicate" word-prop instances [
                 class drop
             ] each
index a668cb791397d8606634e193a5ad7cd8f5e8d8b7..62f9e1c906c2ea83f832e19f9b8e77ddfa6d2fd7 100755 (executable)
@@ -186,13 +186,16 @@ void strip_compiled_quotations(void)
 
 DEFINE_PRIMITIVE(save_image_and_exit)
 {
-       /* This reduces deployed image size */
-       strip_compiled_quotations();
-
+       /* We unbox this before doing anything else. This is the only point
+       where we might throw an error, so we have to throw an error here since
+       later steps destroy the current image. */
        F_CHAR *path = unbox_native_string();
 
        REGISTER_C_STRING(path);
 
+       /* This reduces deployed image size */
+       strip_compiled_quotations();
+
        /* strip out userenv data which is set on startup anyway */
        CELL i;
        for(i = 0; i < FIRST_SAVE_ENV; i++)