From 9b809794544a14f7e27accb5847bc633a4c50d87 Mon Sep 17 00:00:00 2001 From: ggn Date: Mon, 4 Dec 2023 17:30:02 +0200 Subject: [PATCH] Fix for bug #222: 680x0 parser would fail with "reached end of line while parsing expression" in certain conditions --- parmode.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/parmode.h b/parmode.h index 27863d0..bb32320 100644 --- a/parmode.h +++ b/parmode.h @@ -962,10 +962,16 @@ IS_SUPPRESSEDn: { parenthesis_level--; if (parenthesis_level < 0) return error("unbalanced parenthesis in expression"); + if (look_ahead[1] == DOTW || look_ahead[1] == DOTL) + { + tok--; + this_is_an_expression = 1; + break; + } look_ahead++; continue; } - if (*look_ahead == ACONST||*look_ahead==FCONST) + if (*look_ahead == ACONST || *look_ahead == FCONST) { look_ahead += 3; // Skip all the data associated with ACONST continue; @@ -979,7 +985,9 @@ IS_SUPPRESSEDn: // It could be that this is really just an expression prefixing a // register as a displacement... - if (*tok == '(') + // (ggn) Or we could have hit an expression from the peeking above which + // is postifixed by a ".w" or ".l" + if (*tok == '(' || *tok == DOTW || *tok == DOTL) { goto CHK_FOR_DISPn; } -- 2.40.1.windows.1