fix exn raised in refab-struct read errors

Closes PR 11530
This commit is contained in:
Matthew Flatt 2010-12-10 18:33:44 -07:00
parent 2b4f1a6908
commit 2ae9f14f9e
2 changed files with 11 additions and 2 deletions

View File

@ -1069,6 +1069,15 @@
(err/rt-test (readstr "#s((v 0 (2 #f) #()) 1)") exn:fail:read?)
(err/rt-test (readstr "#s((v 0 (2 #f) #(0)) 1)") exn:fail:read?)
(err/rt-test (readstr "#s(1 2)") (lambda (x)
(and (exn:fail:read? x)
(not (exn:fail:read:eof? x)))))
(err/rt-test (readstr "#s(1 2") exn:fail:read:eof?)
(err/rt-test (read-syntax 's (open-input-string "#s((a #(0)) 1)"))
(lambda (x)
(and (exn:fail:read? x)
(not (exn:fail:read:eof? x)))))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(report-errs)

View File

@ -1321,7 +1321,7 @@ read_inner_inner(Scheme_Object *port, Scheme_Object *stxsrc, Scheme_Hash_Table *
st = NULL;
if (!st || (st->num_slots != (SCHEME_VEC_SIZE(v) - 1))) {
scheme_read_err(port, stxsrc, line, col, pos, SPAN(port, pos), EOF, indentation,
scheme_read_err(port, stxsrc, line, col, pos, SPAN(port, pos), 0, indentation,
(SCHEME_VEC_SIZE(v)
? (st
? ("read: mismatch between structure description"
@ -1332,7 +1332,7 @@ read_inner_inner(Scheme_Object *port, Scheme_Object *stxsrc, Scheme_Hash_Table *
}
if (stxsrc && !(MZ_OPT_HASH_KEY(&st->iso) & STRUCT_TYPE_ALL_IMMUTABLE)) {
scheme_read_err(port, stxsrc, line, col, pos, SPAN(port, pos), EOF, indentation,
scheme_read_err(port, stxsrc, line, col, pos, SPAN(port, pos), 0, indentation,
"read: cannot read mutable `#s' form as syntax");
}