From dc0b3942c2de12708ff6d26f2ec3fea226640939 Mon Sep 17 00:00:00 2001 From: jonas Date: Tue, 14 Jan 2014 19:52:20 +0000 Subject: * don't crash when searching for a type helper in an anonymous array (or other non-record/objectdef-based) type (mantis #25504) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@26459 3ad0048d-3df7-0310-abae-a5850022a9f2 --- tests/webtbf/tw25504.pp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/webtbf/tw25504.pp (limited to 'tests/webtbf/tw25504.pp') diff --git a/tests/webtbf/tw25504.pp b/tests/webtbf/tw25504.pp new file mode 100644 index 0000000000..0943da530f --- /dev/null +++ b/tests/webtbf/tw25504.pp @@ -0,0 +1,44 @@ +{ %fail } +program test; + +{$MODE DELPHI} + +{ Commenting the next block of code causes compiler to properly show error message in "Data.HelloWorld". + Otherwise, it throws error: + Fatal: Compilation aborted + An unhandled exception occurred at $00437C5E: + EAccessViolation: Access violation + $00437C5E +} +type +// { + TDateTimeStamp = record + Value: Int64; + end; + +const + InvalidDateTimeStampValue = Low(Int64); + +type + TDateTimeStampHelper = record helper for TDateTimeStamp + const Invalid: TDateTimeStamp = (Value: InvalidDateTimeStampValue); + end; +// } + + TSomeOtherClass = class + end; + + TSomeClass = class + private + Data: array of TSomeOtherClass; + public + procedure Test; + end; + +procedure TSomeClass.Test; +begin + Data.HelloWorld; +end; + +begin +end. -- cgit v1.2.1