diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2014-01-14 19:52:20 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2014-01-14 19:52:20 +0000 |
commit | dc0b3942c2de12708ff6d26f2ec3fea226640939 (patch) | |
tree | 188e75f69896e3a3c30e4b68a6b11bed73e8cafe /tests/webtbf/tw25504.pp | |
parent | ed626205eef27a66cf78ca365165569a4137280f (diff) | |
download | fpc-dc0b3942c2de12708ff6d26f2ec3fea226640939.tar.gz |
* 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
Diffstat (limited to 'tests/webtbf/tw25504.pp')
-rw-r--r-- | tests/webtbf/tw25504.pp | 44 |
1 files changed, 44 insertions, 0 deletions
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. |