dump: Ignore an empty inner_end in dump_value_31().
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 27 Jul 2015 05:37:58 +0000 (22:37 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 27 Jul 2015 05:37:58 +0000 (22:37 -0700)
Now all of the titles in the expanded corpus can be dumped.

dump.c

diff --git a/dump.c b/dump.c
index 88ed52960aa86203ef9d6f041d5d0de1c0900757..f9c315e580090dba9760640859b27eeae344066a 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -256,20 +256,23 @@ dump_value_31(FILE *stream)
 
           int outer_end = pos + get_u32();
           int inner_end = pos + get_u32();
-          match_u32_assert(0);
-          if (match_byte(0x31))
-            {
-              /* Appears to be a template string, e.g. '^1 cells (^2) expf < 5. Min exp = ^3...'.
-                 Probably doesn't actually appear in output because many examples look unpolished,
-                 e.g. 'partial list cases value ^1 shown upper...' */
-              get_string();
-            }
-          else
-            match_byte_assert(0x58);
           if (pos != inner_end)
             {
-              fprintf(stderr, "inner end discrepancy\n");
-              exit(1);
+              match_u32_assert(0);
+              if (match_byte(0x31))
+                {
+                  /* Appears to be a template string, e.g. '^1 cells (^2) expf < 5. Min exp = ^3...'.
+                     Probably doesn't actually appear in output because many examples look unpolished,
+                     e.g. 'partial list cases value ^1 shown upper...' */
+                  get_string();
+                }
+              else
+                match_byte_assert(0x58);
+              if (pos != inner_end)
+                {
+                  fprintf(stderr, "inner end discrepancy\n");
+                  exit(1);
+                }
             }
 
           if (match_byte(0x31))