22:55:42,18 P:[EMAIL PROTECTED]>del withstat.exe 22:55:42,19 P:[EMAIL PROTECTED]>ppc386 -Op1 -al -gl withstat Free Pascal Compiler version 2.1.1 [2005/05/25] for i386 Copyright (c) 1993-2005 by Florian Klaempfl Target OS: Win32 for i386 Compiling withstat.pas withstat.pas(20,50) Warning: Comment level 2 found Assembling withstat Linking withstat.exe 42 Lines compiled, 1.6 sec withstat.pas(19,12) Error: Compilation aborted An unhandled exception occurred at $00000000 : EAccessViolation : Access violation $00000000 $004C96DD TWITHNODE__DESTROY, line 851 of nmem.pas $00546AF9 $0045CF4E TUNARYNODE__DESTROY, line 848 of node.pas $0045D4BF TBINARYNODE__DESTROY, line 962 of node.pas $00546AF9 $004C63FF TBLOCKNODE__DESTROY, line 374 of nbas.pas $00546AF9 $0044643F TPROCDEF__DESTROY, line 3886 of symdef.pas $00546AF9 $0040C51E TINDEXARRAY__CLEAR, line 1974 of cclasses.pas $0040C3F4 TINDEXARRAY__DESTROY, line 1951 of cclasses.pas $0043247D TSYMTABLE__DESTROY, line 192 of symbase.pas $00546AF9 $0041AE22 TMODULE__DESTROY, line 526 of fmodule.pas $0047C520 TPPUMODULE__DESTROY, line 136 of fppu.pas $00546AF9
The program: {$define withWITH} {$define some_inlines} {$r+,q+} {$define integ64} PROGRAM WithStat ; CONST MaxFmtBCDFractionSize = 64 ; TYPE myIntType = {$ifdef integ32} LongInt {$endif} {$ifdef integ64} int64 {$endif} ; TYPE pBCD = ^ tBCD ; tBCD = PACKED RECORD Precision : 0..maxfmtbcdfractionsize ; { 1{joke?}..64 } SignSpecialPlaces : Byte ; { Sign:1, Special:1, Places:6 } Fraction : PACKED ARRAY [ 0..( MaxFmtBCDFractionSize DIV 2 ) - 1 ] OF Byte ; END; CONST NegBit = $80 ; PROCEDURE BCDNegate ( VAR BCD : tBCD ) ; {$ifdef some_inlines} INLINE ; {$endif} BEGIN {$ifdef withWITH} WITH BCD DO IF Precision <> 0 THEN SignSpecialPlaces := SignSpecialPlaces XOR NegBit ; {$else} IF BCD.Precision <> 0 THEN BCD.SignSpecialPlaces := BCD.SignSpecialPlaces XOR NegBit ; {$endif} END ; BEGIN END. The error does not occur if either the "withWITH" or the "some_inlines" stays undefined. With other words, the combination of WITH-statement and INLINE is unhealthy. Gerhard
withstat.pas
Description: Binary data
22:55:42,18 P:[EMAIL PROTECTED]>del withstat.exe 22:55:42,19 P:[EMAIL PROTECTED]>ppc386 -Op1 -al -gl withstat Free Pascal Compiler version 2.1.1 [2005/05/25] for i386 Copyright (c) 1993-2005 by Florian Klaempfl Target OS: Win32 for i386 Compiling withstat.pas withstat.pas(20,50) Warning: Comment level 2 found Assembling withstat Linking withstat.exe 42 Lines compiled, 1.6 sec withstat.pas(19,12) Error: Compilation aborted An unhandled exception occurred at $00000000 : EAccessViolation : Access violation $00000000 $004C96DD TWITHNODE__DESTROY, line 851 of nmem.pas $00546AF9 $0045CF4E TUNARYNODE__DESTROY, line 848 of node.pas $0045D4BF TBINARYNODE__DESTROY, line 962 of node.pas $00546AF9 $004C63FF TBLOCKNODE__DESTROY, line 374 of nbas.pas $00546AF9 $0044643F TPROCDEF__DESTROY, line 3886 of symdef.pas $00546AF9 $0040C51E TINDEXARRAY__CLEAR, line 1974 of cclasses.pas $0040C3F4 TINDEXARRAY__DESTROY, line 1951 of cclasses.pas $0043247D TSYMTABLE__DESTROY, line 192 of symbase.pas $00546AF9 $0041AE22 TMODULE__DESTROY, line 526 of fmodule.pas $0047C520 TPPUMODULE__DESTROY, line 136 of fppu.pas $00546AF9
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel