fix problem with truncated value printing and stack overflow
A value-printing truncation discovered after a stack-overflow handle and return could go badly, because the truncation escape wasn't reset correctly after overflow handling (in contrast to truncation discovered during the overflow handling, which was handled correctly). Closes PR 14870
This commit is contained in:
parent
28f4a39ccb
commit
195a46a23e
|
@ -255,6 +255,18 @@
|
|||
(test +inf.0 print-syntax-width))
|
||||
|
||||
;; ----------------------------------------
|
||||
;; Try to provoke a stack overflow during printing of truncated
|
||||
;; values, ensuring that the stack-overflow handling doesn't
|
||||
;; interfere with the printer escape on truncation:
|
||||
|
||||
(with-handlers ([void void])
|
||||
(let loop ([i 6013])
|
||||
(if (zero? i)
|
||||
(break-thread)
|
||||
(with-handlers ([void (lambda (x y) x)])
|
||||
(loop (sub1 i))))))
|
||||
|
||||
;; ----------------------------------------
|
||||
|
||||
|
||||
(report-errs)
|
||||
|
|
|
@ -1411,13 +1411,15 @@ static Scheme_Object *print_k(void)
|
|||
pp->print_escape = save;
|
||||
return scheme_void;
|
||||
} else {
|
||||
return print(o,
|
||||
p->ku.k.i1,
|
||||
p->ku.k.i2,
|
||||
ht,
|
||||
mt,
|
||||
pp)
|
||||
? scheme_true : scheme_false;
|
||||
int r;
|
||||
r = print(o,
|
||||
p->ku.k.i1,
|
||||
p->ku.k.i2,
|
||||
ht,
|
||||
mt,
|
||||
pp);
|
||||
pp->print_escape = save;
|
||||
return r ? scheme_true : scheme_false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user