mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-24 11:38:20 +02:00
* do not throw an internal error in case of a misplaced string, resolves #39609
This commit is contained in:
parent
8d864559b7
commit
2b66f60a88
@ -3143,7 +3143,14 @@ implementation
|
|||||||
{ add implementations for synthetic method declarations added by
|
{ add implementations for synthetic method declarations added by
|
||||||
the compiler (not for unit/program init functions, their localst
|
the compiler (not for unit/program init functions, their localst
|
||||||
is the staticst -> would duplicate the work done in pmodules) }
|
is the staticst -> would duplicate the work done in pmodules) }
|
||||||
if current_procinfo.procdef.localst.symtabletype=localsymtable then
|
if (current_procinfo.procdef.localst.symtabletype=localsymtable) and
|
||||||
|
{ we cannot call add_synthetic_method_implementations as it throws an internalerror if
|
||||||
|
the token is a string/char. As this is a syntax error and compilation will abort anyways,
|
||||||
|
skipping the call does not matter
|
||||||
|
}
|
||||||
|
(token<>_CSTRING) and
|
||||||
|
(token<>_CWCHAR) and
|
||||||
|
(token<>_CWSTRING) then
|
||||||
add_synthetic_method_implementations(current_procinfo.procdef.localst);
|
add_synthetic_method_implementations(current_procinfo.procdef.localst);
|
||||||
|
|
||||||
{ check for incomplete class definitions, this is only required
|
{ check for incomplete class definitions, this is only required
|
||||||
|
8
tests/webtbf/tw39609.pp
Normal file
8
tests/webtbf/tw39609.pp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{ %fail }
|
||||||
|
procedure A;
|
||||||
|
'Hi.'
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user