2
0
Эх сурвалжийг харах

* when using a pointer as array, the pointer is never written, only read

git-svn-id: trunk@25964 -
florian 11 жил өмнө
parent
commit
6f03d04fe1
1 өөрчлөгдсөн 7 нэмэгдсэн , 2 устгасан
  1. 7 2
      compiler/htypechk.pas

+ 7 - 2
compiler/htypechk.pas

@@ -1135,8 +1135,13 @@ implementation
                      exclude(varstateflags,vsf_must_be_valid);
                    tc_pchar_2_string,
                    tc_pointer_2_array :
-                     include(varstateflags,vsf_must_be_valid);
-                 end;
+                     begin
+                       include(varstateflags,vsf_must_be_valid);
+                       { when a pointer is used for array access, the
+                         pointer itself is read and never written }
+                       newstate := vs_read;
+                     end;
+               end;
                  p:=tunarynode(p).left;
                end;
              subscriptn :