From aaceb5518fe7bf7edd26434cd44a5f0b20230017 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Fri, 26 Aug 2016 14:23:23 +0000 Subject: [PATCH] * fix Mantis #30494 by applying patch from Maciej Izak + added test git-svn-id: trunk@34381 - --- .gitattributes | 1 + compiler/pexpr.pas | 11 +++++++---- tests/webtbf/tw30494.pp | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 tests/webtbf/tw30494.pp diff --git a/.gitattributes b/.gitattributes index 9e917e2303..6c03691e8b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13730,6 +13730,7 @@ tests/webtbf/tw2996.pp svneol=native#text/plain tests/webtbf/tw3000.pp svneol=native#text/plain tests/webtbf/tw30022.pp svneol=native#text/plain tests/webtbf/tw3047.pp svneol=native#text/plain +tests/webtbf/tw30494.pp svneol=native#text/pascal tests/webtbf/tw3114.pp svneol=native#text/plain tests/webtbf/tw3116.pp svneol=native#text/plain tests/webtbf/tw3126.pp svneol=native#text/plain diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index 113a66c8e2..295544e992 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -1456,10 +1456,13 @@ implementation spezdef:=generate_specialization_phase2(spezcontext,tstoreddef(spezdef),false,''); spezcontext.free; spezcontext:=nil; - srsym:=spezdef.typesym; - srsymtable:=srsym.owner; - check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg); - result:=true; + if spezdef<>generrordef then + begin + srsym:=spezdef.typesym; + srsymtable:=srsym.owner; + check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg); + result:=true; + end; end; else internalerror(2015070302); diff --git a/tests/webtbf/tw30494.pp b/tests/webtbf/tw30494.pp new file mode 100644 index 0000000000..1829ce3493 --- /dev/null +++ b/tests/webtbf/tw30494.pp @@ -0,0 +1,15 @@ +{ %FAIL } + +program tw30494; + +{$MODE DELPHI} + +type + TFoo = record + end; + +var + foo: TFoo; +begin +end. +