mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 10:46:18 +02:00
* fix macro nesting check
This commit is contained in:
parent
2b59d1cb5c
commit
6c097b4546
@ -34,6 +34,7 @@ interface
|
|||||||
widestr,cpuinfo;
|
widestr,cpuinfo;
|
||||||
|
|
||||||
const
|
const
|
||||||
|
max_macro_nesting=16;
|
||||||
maxmacrolen=16*1024;
|
maxmacrolen=16*1024;
|
||||||
preprocbufsize=32*1024;
|
preprocbufsize=32*1024;
|
||||||
Newline = #10;
|
Newline = #10;
|
||||||
@ -2071,26 +2072,28 @@ implementation
|
|||||||
mac:=tmacro(macros.search(pattern));
|
mac:=tmacro(macros.search(pattern));
|
||||||
if assigned(mac) and (assigned(mac.buftext)) then
|
if assigned(mac) and (assigned(mac.buftext)) then
|
||||||
begin
|
begin
|
||||||
insertmacro(pattern,mac.buftext,mac.buflen,
|
if yylexcount<max_macro_nesting then
|
||||||
mac.fileinfo.line,mac.fileinfo.fileindex);
|
|
||||||
{ handle empty macros }
|
|
||||||
if c=#0 then
|
|
||||||
begin
|
begin
|
||||||
reload;
|
inc(yylexcount);
|
||||||
case c of
|
insertmacro(pattern,mac.buftext,mac.buflen,
|
||||||
#26 : reload;
|
mac.fileinfo.line,mac.fileinfo.fileindex);
|
||||||
#10,
|
{ handle empty macros }
|
||||||
#13 : linebreak;
|
if c=#0 then
|
||||||
end;
|
begin
|
||||||
end;
|
reload;
|
||||||
{ play it again ... }
|
case c of
|
||||||
inc(yylexcount);
|
#26 : reload;
|
||||||
if yylexcount>16 then
|
#10,
|
||||||
|
#13 : linebreak;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
readtoken;
|
||||||
|
{ that's all folks }
|
||||||
|
dec(yylexcount);
|
||||||
|
exit;
|
||||||
|
end
|
||||||
|
else
|
||||||
Message(scan_w_macro_deep_ten);
|
Message(scan_w_macro_deep_ten);
|
||||||
readtoken;
|
|
||||||
{ that's all folks }
|
|
||||||
dec(yylexcount);
|
|
||||||
exit;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2798,7 +2801,10 @@ exit_label:
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.48 2002-09-16 19:05:48 peter
|
Revision 1.49 2002-11-26 22:56:40 peter
|
||||||
|
* fix macro nesting check
|
||||||
|
|
||||||
|
Revision 1.48 2002/09/16 19:05:48 peter
|
||||||
* parse ^ after nil as caret
|
* parse ^ after nil as caret
|
||||||
|
|
||||||
Revision 1.47 2002/09/06 14:58:42 carl
|
Revision 1.47 2002/09/06 14:58:42 carl
|
||||||
|
Loading…
Reference in New Issue
Block a user