summaryrefslogtreecommitdiffstats
path: root/parser.c
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
commit43f5cf62900830004b53a5df989bad6eece71052 (patch)
tree9a6a4e45746dc7cd1cbb9589af4b5e400dbfdb9b /parser.c
parent5448159471ce57e751853b543a102cca8c6ee7f5 (diff)
downloadtxr-43f5cf62900830004b53a5df989bad6eece71052.tar.gz
txr-43f5cf62900830004b53a5df989bad6eece71052.tar.bz2
txr-43f5cf62900830004b53a5df989bad6eece71052.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.
Diffstat (limited to 'parser.c')
-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);