mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 20:09:25 +02:00
* also check for properties passed to read(ln) when reading integers
different from the native size, or when reading enums (because those are handled via a temp internally -> regular var parameter checks were not automatically performed) git-svn-id: trunk@7398 -
This commit is contained in:
parent
02a69ff049
commit
497df2bb37
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -7319,6 +7319,7 @@ tests/webtbf/tw8777d.pp svneol=native#text/plain
|
||||
tests/webtbf/tw8777e.pp svneol=native#text/plain
|
||||
tests/webtbf/tw8777h.pp svneol=native#text/plain
|
||||
tests/webtbf/tw8777j.pp svneol=native#text/plain
|
||||
tests/webtbf/tw8777k.pp svneol=native#text/plain
|
||||
tests/webtbf/tw8780a.pp svneol=native#text/plain
|
||||
tests/webtbf/tw8780b.pp svneol=native#text/plain
|
||||
tests/webtbf/tw8780c.pp svneol=native#text/plain
|
||||
|
@ -624,6 +624,12 @@ implementation
|
||||
end;
|
||||
if special_handling then
|
||||
begin
|
||||
{ since we're not going to pass the parameter as var-parameter }
|
||||
{ to the read function, manually check whether the parameter }
|
||||
{ can be used as var-parameter (e.g., whether it isn't a }
|
||||
{ property) }
|
||||
valid_for_var(para.left,true);
|
||||
|
||||
{ create the parameter list: the temp ... }
|
||||
temp := ctempcreatenode.create(readfunctype,readfunctype.size,tt_persistent,false);
|
||||
addstatement(Tstatementnode(newstatement),temp);
|
||||
|
34
tests/webtbf/tw8777k.pp
Normal file
34
tests/webtbf/tw8777k.pp
Normal file
@ -0,0 +1,34 @@
|
||||
{ %fail }
|
||||
program BugTest;
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
type
|
||||
TTest = class
|
||||
private
|
||||
FTest: Byte;
|
||||
procedure SetTest(const Value: Byte);
|
||||
public
|
||||
property Test: Byte read FTest write SetTest;
|
||||
end;
|
||||
|
||||
procedure p(var i : byte);
|
||||
begin
|
||||
end;
|
||||
|
||||
{ TTest }
|
||||
|
||||
procedure TTest.SetTest(const Value: Byte);
|
||||
begin
|
||||
Writeln('SetTest called!');
|
||||
FTest := Value;
|
||||
end;
|
||||
|
||||
var
|
||||
Test: TTest;
|
||||
|
||||
begin
|
||||
Test := TTest.Create;
|
||||
Test.Test := 2;
|
||||
ReadLn(Test.Test);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user