diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-03-21 13:26:01 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-03-21 13:40:52 +0300 |
commit | 33f71654136014bac094babaaa81d91245fdd24c (patch) | |
tree | 2090722fc330ded11fb00321a8afd7e0e81bafaa /tests/testsuite.at | |
parent | 121cca61bedf24ba428e019f23b3bbb7160ce162 (diff) | |
download | sciteco-33f71654136014bac094babaaa81d91245fdd24c.tar.gz |
fixed rubout of Q-Register specifications
* This was a regression introduced by 257a0bf128e109442dce91c4aaa1d97fed17ad1a.
* The undo token that frees newly allocated teco_machine_qregspec_t must actually
reset the pointer as well since any subsequent token, pushed by teco_undo_qregspec_own(),
will expect a valid pointer.
* Could have been done via
ctx->expectqreg = NULL;
teco_undo_qregspec_own(ctx->expectqreg);
but using a special clear function requires less memory and is easier to understand.
* Added test case. This wouldn't always crash, but should definitely show up in Valgrind.
Diffstat (limited to 'tests/testsuite.at')
-rw-r--r-- | tests/testsuite.at | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/testsuite.at b/tests/testsuite.at index 86f8331..1c42fe9 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -310,6 +310,12 @@ AT_CHECK([$SCITECO_CMDLINE "@I/F/ J @I/X/ @FK/F/{-6D} Z-2\"N(0/0)'"], 0, ignore, AT_FAIL_IF([$GREP "^Error:" stderr]) AT_CLEANUP +AT_SETUP([Rub out Q-Register specifications]) +# This was causing memory corruptions, that would at least show up under Valgrind. +AT_CHECK([$SCITECO_CMDLINE "GaGb{-4D}"], 0, ignore, stderr) +AT_FAIL_IF([$GREP "^Error:" stderr]) +AT_CLEANUP + AT_SETUP([Searches from macro calls]) AT_CHECK([$SCITECO_CMDLINE "@^Um{:@S/XXX/} :Mm\"S(0/0)' Mm\"S(0/0)'"], 0, ignore, stderr) AT_FAIL_IF([$GREP "^Error:" stderr]) |