From 09b4b16c1075c723de8e285fb400e1a762a87134 Mon Sep 17 00:00:00 2001 From: marcobaye Date: Sat, 24 Feb 2024 14:09:01 +0000 Subject: [PATCH] fixed a bug and added more test files git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@346 4df02467-bbd4-4a76-a152-e7ce94205b78 --- src/acme.c | 2 ++ src/pseudoopcodes.c | 14 +++++++++++++- src/version.h | 2 +- testing/auto/unpseudo.a | 7 ++++++- testing/errors/backslash.a | 2 ++ testing/errors/obsolete4.a | 2 ++ 6 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 testing/errors/backslash.a create mode 100644 testing/errors/obsolete4.a diff --git a/src/acme.c b/src/acme.c index 67bf61b..8c4b7d4 100644 --- a/src/acme.c +++ b/src/acme.c @@ -363,6 +363,8 @@ static boolean do_actual_work(void) perform_pass(); if (--sanity.passes_left < 0) { // FIXME - exit with error + //puts("Exceeded maximum number of passes, please check your sources."); + //break; } } // any errors left? diff --git a/src/pseudoopcodes.c b/src/pseudoopcodes.c index 44f8f34..bca28f7 100644 --- a/src/pseudoopcodes.c +++ b/src/pseudoopcodes.c @@ -721,7 +721,19 @@ static enum eos po_pseudopc(void) pseudopc_start(&new_pc); // if there's a block, parse that and then restore old value! if (parse_optional_block()) { - pseudopc_end(); // restore old state + // restore old state + if (pseudopc_isactive()) { + pseudopc_end(); + } else { + // calling pseudopc_end() here would create a segfault. + // the only way this point can be reached is when the user + // a) asked for an older dialect where "*=" disabled "!pseudopc" + // and + // b) did exactly that in the source. + // + // ...*or* it is a bug! maybe set a flag in the case above which + // can then be checked here, and if it isn't set, call BUG()? + } } else { old_offset_assembly(); } diff --git a/src/version.h b/src/version.h index ed1f15e..5fd7901 100644 --- a/src/version.h +++ b/src/version.h @@ -9,7 +9,7 @@ #define RELEASE "0.97" // update before release FIXME #define CODENAME "Zem" // update before release -#define CHANGE_DATE "18 Feb" // update before release FIXME +#define CHANGE_DATE "19 Feb" // update before release FIXME #define CHANGE_YEAR "2024" // update before release //#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/" #define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME diff --git a/testing/auto/unpseudo.a b/testing/auto/unpseudo.a index 22b3642..7ee5d1f 100644 --- a/testing/auto/unpseudo.a +++ b/testing/auto/unpseudo.a @@ -2,6 +2,11 @@ nop !pseudopc $0300 { nop - !if * != $0301 { !error "pseudo pc is not $301" } + !if * != $0301 { !error "pseudo pc is not $0301" } !if &* != $1002 { !error "un-pseudo'd pc is not $1002" } + *=$0380 + nop + !if * != $0381 { !error "pseudo pc is not $0381" } + !if &* != $1082 { !error "un-pseudo'd pc is not $1082" } } + !if * != $1082 { !error "pc is not $1082" } diff --git a/testing/errors/backslash.a b/testing/errors/backslash.a new file mode 100644 index 0000000..070eaff --- /dev/null +++ b/testing/errors/backslash.a @@ -0,0 +1,2 @@ + *=$1000 + !tx "\q" ; -> "Unsupported backslash sequence." diff --git a/testing/errors/obsolete4.a b/testing/errors/obsolete4.a new file mode 100644 index 0000000..47a86bb --- /dev/null +++ b/testing/errors/obsolete4.a @@ -0,0 +1,2 @@ + !subzone { ; -> ""!subzone {}" is obsolete; use "!zone {}" instead." + }