Browse Source

* mark label as used if address is taken

git-svn-id: trunk@20000 -
florian 13 years ago
parent
commit
7ec6201fb3
3 changed files with 14 additions and 2 deletions
  1. 1 0
      .gitattributes
  2. 7 2
      compiler/nld.pas
  3. 6 0
      tests/tbs/tw0581.pp

+ 1 - 0
.gitattributes

@@ -9266,6 +9266,7 @@ tests/tbs/tb0578.pp svneol=native#text/pascal
 tests/tbs/tb0579.pp svneol=native#text/pascal
 tests/tbs/tb0579.pp svneol=native#text/pascal
 tests/tbs/tb0580.pp svneol=native#text/pascal
 tests/tbs/tb0580.pp svneol=native#text/pascal
 tests/tbs/tb205.pp svneol=native#text/plain
 tests/tbs/tb205.pp svneol=native#text/plain
+tests/tbs/tw0581.pp svneol=native#text/pascal
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain
 tests/tbs/ub0119.pp svneol=native#text/plain
 tests/tbs/ub0119.pp svneol=native#text/plain

+ 7 - 2
compiler/nld.pas

@@ -42,7 +42,9 @@ interface
          { the loadnode is generated internally and a varspez=vs_const should be ignore,
          { the loadnode is generated internally and a varspez=vs_const should be ignore,
            this requires that the parameter is actually passed by value
            this requires that the parameter is actually passed by value
            Be really carefull when using this flag! }
            Be really carefull when using this flag! }
-         loadnf_isinternal_ignoreconst
+         loadnf_isinternal_ignoreconst,
+
+         loadnf_only_uninitialized_hint
         );
         );
 
 
        tloadnode = class(tunarynode)
        tloadnode = class(tunarynode)
@@ -356,7 +358,10 @@ implementation
                  typecheckpass(left);
                  typecheckpass(left);
              end;
              end;
            labelsym:
            labelsym:
-             resultdef:=voidtype;
+             begin
+               tlabelsym(symtableentry).used:=true;
+               resultdef:=voidtype;
+             end;
            else
            else
              internalerror(200104141);
              internalerror(200104141);
          end;
          end;

+ 6 - 0
tests/tbs/tw0581.pp

@@ -0,0 +1,6 @@
+{ %fail }
+label
+  l;
+begin
+  writeln(hexstr(ptrint(@l),sizeof(ptrint)*2));
+end.