|
@@ -535,6 +535,22 @@ implementation
|
|
|
|
|
|
|
|
|
|
function taddrnode.pass_typecheck:tnode;
|
|
function taddrnode.pass_typecheck:tnode;
|
|
|
|
+
|
|
|
|
+ procedure check_mark_read_written;
|
|
|
|
+ begin
|
|
|
|
+ if mark_read_written then
|
|
|
|
+ begin
|
|
|
|
+ { This is actually only "read", but treat it nevertheless as
|
|
|
|
+ modified due to the possible use of pointers
|
|
|
|
+ To avoid false positives regarding "uninitialised"
|
|
|
|
+ warnings when using arrays, perform it in two steps }
|
|
|
|
+ set_varstate(left,vs_written,[]);
|
|
|
|
+ { vsf_must_be_valid so it doesn't get changed into
|
|
|
|
+ vsf_referred_not_inited }
|
|
|
|
+ set_varstate(left,vs_read,[vsf_must_be_valid]);
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+
|
|
var
|
|
var
|
|
hp : tnode;
|
|
hp : tnode;
|
|
hsym : tfieldvarsym;
|
|
hsym : tfieldvarsym;
|
|
@@ -629,9 +645,11 @@ implementation
|
|
end
|
|
end
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
|
|
+ check_mark_read_written;
|
|
{ Return the typeconvn only }
|
|
{ Return the typeconvn only }
|
|
result:=left;
|
|
result:=left;
|
|
left:=nil;
|
|
left:=nil;
|
|
|
|
+ exit;
|
|
end;
|
|
end;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
@@ -650,17 +668,8 @@ implementation
|
|
CGMessage(type_e_variable_id_expected);
|
|
CGMessage(type_e_variable_id_expected);
|
|
end;
|
|
end;
|
|
|
|
|
|
- if mark_read_written then
|
|
|
|
- begin
|
|
|
|
- { This is actually only "read", but treat it nevertheless as }
|
|
|
|
- { modified due to the possible use of pointers }
|
|
|
|
- { To avoid false positives regarding "uninitialised" }
|
|
|
|
- { warnings when using arrays, perform it in two steps }
|
|
|
|
- set_varstate(left,vs_written,[]);
|
|
|
|
- { vsf_must_be_valid so it doesn't get changed into }
|
|
|
|
- { vsf_referred_not_inited }
|
|
|
|
- set_varstate(left,vs_read,[vsf_must_be_valid]);
|
|
|
|
- end;
|
|
|
|
|
|
+ check_mark_read_written;
|
|
|
|
+
|
|
if not(assigned(result)) then
|
|
if not(assigned(result)) then
|
|
result:=simplify(false);
|
|
result:=simplify(false);
|
|
end;
|
|
end;
|