From f3365350354215975fe41d2c5f15231daa8d2dc7 Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 18 Oct 2005 20:12:54 +0000 Subject: [PATCH] Merged revisions 1479 via svnmerge from http://svn.freepascal.org/svn/fpc/trunk r1479 (florian) + proper init rtti for proc. vars git-svn-id: branches/fixes_2_0@1480 - --- .gitattributes | 1 + compiler/symconst.pas | 1 + compiler/symdef.pas | 5 +++++ tests/webtbs/tw4239.pp | 21 +++++++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 tests/webtbs/tw4239.pp diff --git a/.gitattributes b/.gitattributes index d0bf591079..7e472764d4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6040,6 +6040,7 @@ tests/webtbs/tw4219.pp svneol=native#text/plain tests/webtbs/tw4233.pp svneol=native#text/plain tests/webtbs/tw4234.pp svneol=native#text/plain tests/webtbs/tw4234a.pp svneol=native#text/plain +tests/webtbs/tw4239.pp svneol=native#text/plain tests/webtbs/tw4240.pp svneol=native#text/plain tests/webtbs/tw4247.pp svneol=native#text/plain tests/webtbs/tw4253.pp svneol=native#text/plain diff --git a/compiler/symconst.pas b/compiler/symconst.pas index 0f4a98e507..2e6382cab8 100644 --- a/compiler/symconst.pas +++ b/compiler/symconst.pas @@ -65,6 +65,7 @@ const tkA16string = 23; tkA64string = 24; {$endif} + tkprocvar = 25; otSByte = 0; otUByte = 1; diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 080081c7e1..305385fabd 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -4949,6 +4949,11 @@ implementation { write name of result type } tstoreddef(rettype.def).write_rtti_name; + end + else + begin + asmlist[al_rtti].concat(Tai_const.Create_8bit(tkprocvar)); + write_rtti_name; end; end; diff --git a/tests/webtbs/tw4239.pp b/tests/webtbs/tw4239.pp new file mode 100644 index 0000000000..6aa52ad171 --- /dev/null +++ b/tests/webtbs/tw4239.pp @@ -0,0 +1,21 @@ +{ Source provided for Free Pascal Bug Report 4239 } +{ Submitted by "Lars" on 2005-07-30 } +{ e-mail: L@z505.com } +program Project1; + +{$mode objfpc}{$H+} + +var + MyProc: array of procedure(s:string); + +procedure testing(s:string); +begin + writeln(s); +end; + +begin + setlength(myproc,1); + MyProc[0]:=@testing; + MyProc[0]('Test me'); + readln; //watch for error on close +end.