diff options
-rw-r--r-- | parser.c | 10 | ||||
-rw-r--r-- | share/txr/stdlib/compiler.tl | 1 |
2 files changed, 10 insertions, 1 deletions
@@ -610,6 +610,7 @@ static val read_file_common(val stream, val error_stream, val compiled) { val error_val = gensym(nil); val name = stream_get_prop(stream, name_k); + val first = t; for (;;) { val form = lisp_parse(stream, error_stream, error_val, name, colon_k); @@ -623,7 +624,14 @@ static val read_file_common(val stream, val error_stream, val compiled) continue; } - if (compiled) { + if (compiled && first) { + val major = pop(&form); + if (gt(major, zero)) + uw_throwf(error_s, + lit("cannot load ~s; it was compiled by a newer implementation"), + stream, nao); + first = nil; + } else if (compiled) { val nlevels = pop(&form); val nregs = pop(&form); val bytecode = pop(&form); diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl index 24fa5c2a..a75b4571 100644 --- a/share/txr/stdlib/compiler.tl +++ b/share/txr/stdlib/compiler.tl @@ -1374,6 +1374,7 @@ (when *emit* (let ((*print-circle* t)) (prinl flat-vd out-stream)))))))))) + (prinl '(0 0) out-stream) (whilet ((obj (read in-stream *stderr* err-ret)) ((neq obj err-ret))) (compile-form (sys:expand* obj))) |