The following program (with an error in it) crashes the compiler. The error (BSET undeclared) is detected, but then the compiler crashes trying to bail out.
I'm using gpc-20050331/gcc-3.4.3 with the delphi object patch.
Program, execution, and crash report follows. Peter.
program peterM;
type MyCollection = object function GetDataHandle: Integer; end;
function MyCollection.GetDataHandle: Integer; var flags: longint; begin flags := 0; BSET(flags, 16); GetDataHandle := flags; end;
begin WriteLn( 'OK' ); end.
gpc -o peterM peterM.pas peterM.pas: In method `MyCollection.GetDataHandle': peterM.pas:14: error: undeclared identifier `BSET' (first use in this routine) peterM.pas:14: error: (Each undeclared identifier is reported only once peterM.pas:14: error: for each routine it appears in.) peterM.pas:15: confused by earlier errors, bailing out [crash]
Date/Time: 2005-06-27 12:32:35.975 +0800 OS Version: 10.4.1 (Build 8B15) Report Version: 3
Command: gpc1 Path: /Developer/Pascal/gpc-20050331/libexec/gcc/powerpc-apple-darwin8.1.0/3.4.3/gpc1 Parent: gpc [2697]
Version: ??? (???)
PID: 2699 Thread: 0
Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000034
Thread 0 Crashed: 0 gpc1 0x0005324c expand_pascal_assignment + 288 (statements.c:1116) 1 gpc1 0x00009048 yyuserAction + 22488 (parse.c:4561) 2 gpc1 0x00010f9c main_yyparse + 544 (parse.c:7900) 3 gpc1 0x000c17c4 toplev_main + 1976 (toplev.c:1826) 4 gpc1 0x00002438 _start + 344 (crt.c:272) 5 gpc1 0x000022dc start + 60
Thread 0 crashed with PPC Thread State: srr0: 0x0005324c srr1: 0x0200f930 vrsave: 0x00000000 cr: 0x44004242 xer: 0x00000000 lr: 0x00053138 ctr: 0x00008ff4 r0: 0x00000028 r1: 0xbfffed00 r2: 0x00000000 r3: 0x40d29078 r4: 0x40d21e00 r5: 0xfefefeff r6: 0x80808080 r7: 0x00000000 r8: 0x00000000 r9: 0x40d26000 r10: 0x40d25b80 r11: 0x40d25b80 r12: 0x00008080 r13: 0x0033ad0c r14: 0x003455d8 r15: 0x00000001 r16: 0x0044bca8 r17: 0x0033a2fc r18: 0x00300d84 r19: 0x00000190 r20: 0x00300d84 r21: 0x00345be4 r22: 0x404cc4bc r23: 0x00000029 r24: 0xa0001bc8 r25: 0x00340d84 r26: 0x00000000 r27: 0x00000000 r28: 0x40d21e00 r29: 0x40d26f80 r30: 0x40d29078 r31: 0x00053138
Binary Images Description: 0x1000 - 0x443fff gpc1 /Developer/Pascal/gpc-20050331/libexec/gcc/powerpc-apple-darwin8.1.0/3.4.3/gpc1 0x40b54000 - 0x40b5bfff libintl.3.dylib /usr/local/lib/libintl.3.dylib 0x8fe00000 - 0x8fe50fff dyld 43 /usr/lib/dyld 0x90000000 - 0x901a6fff libSystem.B.dylib /usr/lib/libSystem.B.dylib 0x901fe000 - 0x90202fff libmathCommon.A.dylib /usr/lib/system/libmathCommon.A.dylib 0x90727000 - 0x90800fff com.apple.CoreFoundation 6.4.1 (368.1) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x9084b000 - 0x9094dfff libicucore.A.dylib /usr/lib/libicucore.A.dylib 0x909a7000 - 0x90a2bfff libobjc.A.dylib /usr/lib/libobjc.A.dylib 0x90ae3000 - 0x90af5fff libauto.dylib /usr/lib/libauto.dylib 0x91d33000 - 0x91d53fff libmx.A.dylib /usr/lib/libmx.A.dylib 0x92c9b000 - 0x92d89fff libiconv.2.dylib /usr/lib/libiconv.2.dylib 0x93614000 - 0x9361cfff libgcc_s.1.dylib /usr/lib/libgcc_s.1.dylib
Model: PowerMac7,3, BootROM 5.1.8f7, 2 processors, PowerPC G5 (3.0), 2 GHz, 1.5 GB Graphics: GeForce FX 5200, GeForce FX 5200, AGP, 64 MB Memory Module: DIMM0/J11, 256 MB, DDR SDRAM, PC3200U-30330 Memory Module: DIMM1/J12, 256 MB, DDR SDRAM, PC3200U-30330 Memory Module: DIMM2/J13, 512 MB, DDR SDRAM, PC3200U-30330 Memory Module: DIMM3/J14, 512 MB, DDR SDRAM, PC3200U-30330 Modem: Jump, , V.92, Version 1.0, Network Service: Built-in Ethernet, Ethernet, en0 Serial ATA Device: ST3160023AS, 149.05 GB Parallel ATA Device: HL-DT-ST DVD-RW GWA-4082B, USB Device: CanoScan, Canon, Up to 12 Mb/sec, 500 mA USB Device: Hub, , Up to 12 Mb/sec, 500 mA USB Device: CF076, CF076, Up to 12 Mb/sec, 500 mA USB Device: Hub in Apple Pro Keyboard, Chicony, Up to 12 Mb/sec, 500 mA USB Device: Apple Optical USB Mouse, Logitech, Up to 1.5 Mb/sec, 100 mA USB Device: Apple Pro Keyboard, Chicony, Up to 12 Mb/sec, 250 mA USB Device: Studio Display, , Up to 1.5 Mb/sec, 500 mA