ソースを参照

* mark label as used if address is taken

git-svn-id: trunk@20000 -
florian 13 年 前
コミット
7ec6201fb3
3 ファイル変更14 行追加2 行削除
  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/tb0580.pp svneol=native#text/pascal
 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/ub0069.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,
            this requires that the parameter is actually passed by value
            Be really carefull when using this flag! }
-         loadnf_isinternal_ignoreconst
+         loadnf_isinternal_ignoreconst,
+
+         loadnf_only_uninitialized_hint
         );
 
        tloadnode = class(tunarynode)
@@ -356,7 +358,10 @@ implementation
                  typecheckpass(left);
              end;
            labelsym:
-             resultdef:=voidtype;
+             begin
+               tlabelsym(symtableentry).used:=true;
+               resultdef:=voidtype;
+             end;
            else
              internalerror(200104141);
          end;

+ 6 - 0
tests/tbs/tw0581.pp

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