From 7ec6201fb3ad37de6cab9546227823632ae65a89 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 7 Jan 2012 21:53:21 +0000 Subject: [PATCH] * mark label as used if address is taken git-svn-id: trunk@20000 - --- .gitattributes | 1 + compiler/nld.pas | 9 +++++++-- tests/tbs/tw0581.pp | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 tests/tbs/tw0581.pp diff --git a/.gitattributes b/.gitattributes index ddfed5938f..fb894cae7a 100644 --- a/.gitattributes +++ b/.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 diff --git a/compiler/nld.pas b/compiler/nld.pas index 5a7b08cc42..fee574e152 100644 --- a/compiler/nld.pas +++ b/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; diff --git a/tests/tbs/tw0581.pp b/tests/tbs/tw0581.pp new file mode 100644 index 0000000000..6cde14b51c --- /dev/null +++ b/tests/tbs/tw0581.pp @@ -0,0 +1,6 @@ +{ %fail } +label + l; +begin + writeln(hexstr(ptrint(@l),sizeof(ptrint)*2)); +end.