From d8a2c47c7579289f8de282bfca791d5761a23f8c Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Thu, 11 Aug 2011 20:08:43 +0000 Subject: [PATCH] * fixed calling inherited message handlers after r18162 git-svn-id: trunk@18173 - --- .gitattributes | 1 + compiler/htypechk.pas | 22 ++++++++++++--- tests/tbs/tb0577a.pp | 63 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 tests/tbs/tb0577a.pp diff --git a/.gitattributes b/.gitattributes index eebeeee392..cbe72fb900 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9134,6 +9134,7 @@ tests/tbs/tb0574.pp svneol=native#text/pascal tests/tbs/tb0575.pp svneol=native#text/plain tests/tbs/tb0576.pp svneol=native#text/plain tests/tbs/tb0577.pp svneol=native#text/plain +tests/tbs/tb0577a.pp svneol=native#text/plain tests/tbs/tb205.pp svneol=native#text/plain tests/tbs/ub0060.pp svneol=native#text/plain tests/tbs/ub0069.pp svneol=native#text/plain diff --git a/compiler/htypechk.pas b/compiler/htypechk.pas index 669c958643..7de4c646e4 100644 --- a/compiler/htypechk.pas +++ b/compiler/htypechk.pas @@ -1810,10 +1810,24 @@ implementation pd:=tprocdef(srsym.ProcdefList[j]); { in case of anonymous inherited, only match procdefs identical to the current one (apart from hidden parameters), rather than - anything compatible to the parameters } - if anoninherited and - (compare_paras(current_procinfo.procdef.paras,pd.paras,cp_all,[cpo_ignorehidden])current_procinfo.procdef.messageinf.i) then + continue + end + else if po_msgstr in current_procinfo.procdef.procoptions then + begin + if not(po_msgstr in pd.procoptions) or + (pd.messageinf.str^<>current_procinfo.procdef.messageinf.str^) then + continue + end + else if (compare_paras(current_procinfo.procdef.paras,pd.paras,cp_all,[cpo_ignorehidden])cinheritedhandler then + halt(2); + c.handler(c); + if glob<>cdefaulthandler then + halt(3); +end.