From ff2d1376a1456d5c06e208eedd9dbc65e71e81b4 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 30 Oct 2024 13:54:28 +0300 Subject: fixed invalid memory access when executing the F< command (but only when jumping to the beginning of the macro) * I am not sure whether this feature is really that useful... * teco_machine_main_t::macro_pc is now pointing to the __next__ character to execute, therefore it's easier to manipulate by flow control commands. Also, it can now be unsigned (gsize) like all other program counters. * Detected thanks to running the testsuite under Valgrind. --- src/core-commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core-commands.c') diff --git a/src/core-commands.c b/src/core-commands.c index 0cde7e0..27f5c64 100644 --- a/src/core-commands.c +++ b/src/core-commands.c @@ -1292,7 +1292,7 @@ teco_state_fcommand_loop_start(teco_machine_main_t *ctx, GError **error) /* outside of loop */ if (!teco_expressions_discard_args(error)) return; - ctx->macro_pc = -1; + ctx->macro_pc = 0; return; } -- cgit v1.2.3