From faeae21c4621849e3c7e7393e504e36b54928555 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 8 Jun 2022 21:40:13 -0700 Subject: listener: bugfix: handle warnings around linenoise. * parser.c (repl): Also push and pop the warning handler around the linenoise call, like we do around evaluation. The reason is that when the library is used in source code form, it can generate warnings while loading. Loading can be triggered by completion from inside linenoise. Neglecting to handle warnings and throw a continue causes a problem because the warnings then fall victim to the listener's master catch. That then interferes with the load. --- parser.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parser.c b/parser.c index 60fd0655..1a375bd7 100644 --- a/parser.c +++ b/parser.c @@ -1647,8 +1647,12 @@ val repl(val bindings, val in_stream, val out_stream, val env) uw_catch_begin (catch_all, exsym, exvals); + uw_push_handler(&uw_handler, cons(warning_s, nil), rw_f); + line_w = linenoise(ls, c_str(prompt, self)); + uw_pop_frame(&uw_handler); + #if CONFIG_FULL_REPL rplacd(multi_line_var, tnil(lino_get_multiline(ls))); #endif -- cgit v1.2.3