Compiler crash in 3.0.4 RC1 and Trunk when feeding it illegal/unfinished code
Original Reporter info from Mantis: Thaddy
-
Reporter name: Thaddy de Koning
Original Reporter info from Mantis: Thaddy
- Reporter name: Thaddy de Koning
Description:
During tests with 3.0.4 rc1 I by accident encountered a compiler crash that I could also reproduce in trunk:
pi@raspberrypi:~/fpcdemos $ /usr/local/lib/fpc/3.0.4/ppcarm -Fu/usr/local/lib/fpc/3.0.4/units/* -B -O- attributestest.pas
Free Pascal Compiler version 3.0.4rc1 [2017/06/29] for arm
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for ARMHF
Compiling attributestest.pas
Fatal: Compilation aborted
An unhandled exception occurred at $00151F74:
EAccessViolation: Access violation<br/>
$00151F74
$00150B2C
$0015491C
$00145C4C
$00148D94
Steps to reproduce:
program compilercrash;
// This code is nonsense a.t.m. but it crashes the compiler.
{$mode objfpc}
uses classes;
type
{$M+}
Tmyclass = class(Tpersistent)
private
FDetachable:Boolean;
procedure setdetachable(const aValue:Boolean);
public
property Detachable: Boolean read FDetachable write SetDetachable
['widgetsets:qt,gtk,win32', 'implementor:Vasya Pupkin', 'creation-date:01.01.2007'];
end;
begin
end.
Additional information:
The code is not valid code at the moment, and even incomplete, but it should not crash the compiler. It crashes in 3.0.2, 3.0.4 rc1 and trunk.
Background: I was also experimenting with the attributes branch, mixed things up and fed it to 3.0.4
Mantis conversion info:
- Mantis ID: 32075
- OS: Raspbian
- OS Build: Jessie
- Build: 36614
- Platform: armhf
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 38272 (#ad4ad829)