From 43f5cf62900830004b53a5df989bad6eece71052 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 28 Jan 2022 23:50:42 -0800 Subject: listener: line_w must be volatile now. * parser.c (repl): The line_w variable must be volatile because it's modified after we save the context for catching exceptions. Without this, I'm seeing that expressions that throw an exception are not being entered into the linenoise history, because the exception catch restores the null initial value of line_w. --- parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser.c b/parser.c index 0c90ceff..645b933f 100644 --- a/parser.c +++ b/parser.c @@ -1471,7 +1471,7 @@ val repl(val bindings, val in_stream, val out_stream, val env) lino_ctx, lino_ctx = lino_make(coerce(mem_t *, in_stream), coerce(mem_t *, out_stream))); - wchar_t *line_w = 0; + wchar_t *volatile line_w = 0; val quit_k = intern(lit("quit"), keyword_package); val read_k = intern(lit("read"), keyword_package); val prompt_k = intern(lit("prompt"), keyword_package); -- cgit v1.2.3