mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 20:09:20 +02:00
* don't allow properties to expose private fields of parent classes
(mantis #14650) git-svn-id: trunk@13794 -
This commit is contained in:
parent
da8355c830
commit
1eceb2ca65
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -8711,6 +8711,8 @@ tests/webtbf/tw14104b.pp svneol=native#text/plain
|
|||||||
tests/webtbf/tw14104c.pp svneol=native#text/plain
|
tests/webtbf/tw14104c.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw14248.pp svneol=native#text/plain
|
tests/webtbf/tw14248.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw1432.pp svneol=native#text/plain
|
tests/webtbf/tw1432.pp svneol=native#text/plain
|
||||||
|
tests/webtbf/tw14650.pp svneol=native#text/plain
|
||||||
|
tests/webtbf/tw14650a.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw1467.pp svneol=native#text/plain
|
tests/webtbf/tw1467.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw1483.pp svneol=native#text/plain
|
tests/webtbf/tw1483.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw1599.pp svneol=native#text/plain
|
tests/webtbf/tw1599.pp svneol=native#text/plain
|
||||||
|
@ -88,6 +88,9 @@ implementation
|
|||||||
searchsym(pattern,sym,srsymtable);
|
searchsym(pattern,sym,srsymtable);
|
||||||
if assigned(sym) then
|
if assigned(sym) then
|
||||||
begin
|
begin
|
||||||
|
if assigned(aclass) and
|
||||||
|
not is_visible_for_object(sym,aclass) then
|
||||||
|
Message(parser_e_cant_access_private_member);
|
||||||
case sym.typ of
|
case sym.typ of
|
||||||
fieldvarsym :
|
fieldvarsym :
|
||||||
begin
|
begin
|
||||||
|
16
tests/webtbf/tw14650.pp
Normal file
16
tests/webtbf/tw14650.pp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{ %fail }
|
||||||
|
|
||||||
|
{$mode objfpc}
|
||||||
|
|
||||||
|
type
|
||||||
|
tc = class
|
||||||
|
strict private
|
||||||
|
fa: longint;
|
||||||
|
end;
|
||||||
|
|
||||||
|
tcc = class(tc)
|
||||||
|
property a: longint read fa;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
15
tests/webtbf/tw14650a.pp
Normal file
15
tests/webtbf/tw14650a.pp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{ %fail }
|
||||||
|
|
||||||
|
{$mode objfpc}
|
||||||
|
|
||||||
|
uses
|
||||||
|
classes;
|
||||||
|
|
||||||
|
type
|
||||||
|
TPublicQueueList = class(tfplist)
|
||||||
|
public
|
||||||
|
property List: PPointerList read FList;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user