summaryrefslogtreecommitdiff
path: root/compiler/scanner.pas
diff options
context:
space:
mode:
authornickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-27 23:11:09 +0000
committernickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-27 23:11:09 +0000
commita491c935588745154b576226b73833bac78fcb6e (patch)
tree973289073fb5d21573a6be2b5cfeba9abd2a9472 /compiler/scanner.pas
parent38b5e0606069cc5985e995e1da5b6855db67f507 (diff)
parentae5b0de491a91321675f73eae5db628d068f4e05 (diff)
downloadfpc-unicodekvm.tar.gz
* synchronized with trunkunicodekvm
git-svn-id: https://svn.freepascal.org/svn/fpc/branches/unicodekvm@49282 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/scanner.pas')
-rw-r--r--compiler/scanner.pas19
1 files changed, 14 insertions, 5 deletions
diff --git a/compiler/scanner.pas b/compiler/scanner.pas
index b33f7a73c5..9632471f24 100644
--- a/compiler/scanner.pas
+++ b/compiler/scanner.pas
@@ -4883,12 +4883,21 @@ type
inc(yylexcount);
substitutemacro(pattern,mac.buftext,mac.buflen,
mac.fileinfo.line,mac.fileinfo.fileindex);
- { handle empty macros }
+ { handle empty macros }
if c=#0 then
- reload;
- readtoken(false);
- { that's all folks }
- dec(yylexcount);
+ begin
+ reload;
+ { avoid macro nesting error in case of
+ a sequence of empty macros, see #38802 }
+ dec(yylexcount);
+ readtoken(false);
+ end
+ else
+ begin
+ readtoken(false);
+ { that's all folks }
+ dec(yylexcount);
+ end;
exit;
end
else