* allow deref of loop variable

git-svn-id: trunk@981 -
This commit is contained in:
peter 2005-08-30 05:51:39 +00:00
parent 813e21fbd8
commit 62972054c4
3 changed files with 19 additions and 0 deletions

1
.gitattributes vendored
View File

@ -6187,6 +6187,7 @@ tests/webtbs/tw4247.pp svneol=native#text/plain
tests/webtbs/tw4253.pp svneol=native#text/plain
tests/webtbs/tw4260.pp svneol=native#text/plain
tests/webtbs/tw4277.pp svneol=native#text/plain
tests/webtbs/tw4308.pp svneol=native#text/plain
tests/webtbs/tw4336.pp svneol=native#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain
tests/webtbs/ub1883.pp svneol=native#text/plain

View File

@ -1143,6 +1143,7 @@ implementation
begin
{ loop counter? }
if not(Valid_Const in opts) and
not gotderef and
(vo_is_loop_counter in tabstractvarsym(tloadnode(hp).symtableentry).varoptions) then
CGMessage1(parser_e_illegal_assignment_to_count_var,tloadnode(hp).symtableentry.realname);
{ derefed pointer }

17
tests/webtbs/tw4308.pp Executable file
View File

@ -0,0 +1,17 @@
{ Source provided for Free Pascal Bug Report 4308 }
{ Submitted by "Olle" on 2005-08-22 }
{ e-mail: olle.r@automagika.se }
program loop_var_assgn;
procedure ZeroBlock (startAddr: PtrUInt; length: SizeUInt);
var
i: PtrUInt;
begin
for i := startAddr to startAddr + length - 1 do
PByte(i)^ := 0;
end;
begin
end.