* prevent crash on not yet supported attribute declarations, resolves #32075

git-svn-id: trunk@38272 -
This commit is contained in:
florian 2018-02-17 19:57:50 +00:00
parent f37bad774c
commit ad4ad82908
3 changed files with 22 additions and 1 deletions

1
.gitattributes vendored
View File

@ -14349,6 +14349,7 @@ tests/webtbf/tw3186.pp svneol=native#text/plain
tests/webtbf/tw31973.pp svneol=native#text/pascal tests/webtbf/tw31973.pp svneol=native#text/pascal
tests/webtbf/tw32043b.pp svneol=native#text/pascal tests/webtbf/tw32043b.pp svneol=native#text/pascal
tests/webtbf/tw32043c.pp svneol=native#text/pascal tests/webtbf/tw32043c.pp svneol=native#text/pascal
tests/webtbf/tw32075.pp svneol=native#text/pascal
tests/webtbf/tw3218.pp svneol=native#text/plain tests/webtbf/tw3218.pp svneol=native#text/plain
tests/webtbf/tw3241.pp svneol=native#text/plain tests/webtbf/tw3241.pp svneol=native#text/plain
tests/webtbf/tw32412a.pp svneol=native#text/pascal tests/webtbf/tw32412a.pp svneol=native#text/pascal

View File

@ -175,7 +175,7 @@ implementation
begin begin
consume(_LECKKLAMMER); consume(_LECKKLAMMER);
repeat repeat
if def.typ=arraydef then if assigned(def) and (def.typ=arraydef) then
begin begin
idx:=0; idx:=0;
p:=comp_expr([ef_accept_equal]); p:=comp_expr([ef_accept_equal]);

20
tests/webtbf/tw32075.pp Normal file
View File

@ -0,0 +1,20 @@
{ %fail }
program compilercrash;
// This code is nonsense a.t.m. but it crashes the compiler.
{$mode objfpc}
uses classes;
type
{$M+}
Tmyclass = class(Tpersistent)
private
FDetachable:Boolean;
procedure setdetachable(const aValue:Boolean);
public
property Detachable: Boolean read FDetachable write SetDetachable
['widgetsets:qt,gtk,win32', 'implementor:Vasya Pupkin', 'creation-date:01.01.2007'];
end;
begin
{ the initial purpose of this test was that the compiler shouldn't crash on the attribute above,
however, as soon as attributes are implemented, it will succeed, so cause always an error at the end }
end;