summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-01-28 23:50:42 -0800
committerKaz Kylheku <kaz@kylheku.com>2022-01-28 23:50:42 -0800
commitae8178b5d0b1e5c4d0564c54313ea1957f768996 (patch)
tree9a6a4e45746dc7cd1cbb9589af4b5e400dbfdb9b
parent0a9872434b70f974b028ebd8f6b614c81aa605bf (diff)
downloadtxr-ae8178b5d0b1e5c4d0564c54313ea1957f768996.tar.gz
txr-ae8178b5d0b1e5c4d0564c54313ea1957f768996.tar.bz2
txr-ae8178b5d0b1e5c4d0564c54313ea1957f768996.zip
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.
-rw-r--r--parser.c2
1 files changed, 1 insertions, 1 deletions
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);