* Fix for 24274 by Laco

git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24249 3ad0048d-3df7-0310-abae-a5850022a9f2
* Test for 24274

git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24250 3ad0048d-3df7-0310-abae-a5850022a9f2