From 3d2ee097b5b154000d95490d9b184ca69a8e4aa0 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Sun, 15 Nov 2020 16:27:26 +0000 Subject: [PATCH] * fix for Mantis #38083: ensure that the sp_generic_dummy flag is set correctly on the new procsym when replacing a dummy sym + added test git-svn-id: trunk@47424 - --- .gitattributes | 1 + compiler/pdecsub.pas | 5 +++++ tests/webtbs/tw38083.pp | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 tests/webtbs/tw38083.pp diff --git a/.gitattributes b/.gitattributes index 303751a9fb..01551f5dde 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18531,6 +18531,7 @@ tests/webtbs/tw38051.pp svneol=native#text/pascal tests/webtbs/tw38054.pp svneol=native#text/plain tests/webtbs/tw38069.pp svneol=native#text/pascal tests/webtbs/tw38074.pp svneol=native#text/pascal +tests/webtbs/tw38083.pp svneol=native#text/pascal tests/webtbs/tw3814.pp svneol=native#text/plain tests/webtbs/tw3827.pp svneol=native#text/plain tests/webtbs/tw3829.pp svneol=native#text/plain diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas index baeb3e6acc..eb4c6d0649 100644 --- a/compiler/pdecsub.pas +++ b/compiler/pdecsub.pas @@ -535,6 +535,7 @@ implementation procstartfilepos : tfileposinfo; i, index : longint; + addgendummy, hadspecialize, firstpart, found, @@ -867,6 +868,7 @@ implementation srsym:=nil; genericparams:=nil; hadspecialize:=false; + addgendummy:=false; if not assigned(genericdef) then begin @@ -1071,6 +1073,7 @@ implementation as if nothing happened } hidesym(srsym); searchagain:=true; + addgendummy:=true; end else begin @@ -1106,6 +1109,8 @@ implementation aprocsym:=cprocsym.create('$'+lower(sp)) else aprocsym:=cprocsym.create(orgsp); + if addgendummy then + include(aprocsym.symoptions,sp_generic_dummy); symtablestack.top.insert(aprocsym); end; end; diff --git a/tests/webtbs/tw38083.pp b/tests/webtbs/tw38083.pp new file mode 100644 index 0000000000..e6e16b7bde --- /dev/null +++ b/tests/webtbs/tw38083.pp @@ -0,0 +1,19 @@ +{ %NORUN } + +program tw38083; + +{$MODE Delphi} + + procedure Test(A: T; B: Boolean); overload; + begin + + end; + + procedure Test(A: String); overload; + begin + Test(A, True); + end; + +begin + +end.