Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-04

Compiler raise an EAbort exception

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hello,

I'm using FPC from Arch Liunx.

I'm trying to do the following code:

...
TNumberValidationRecord = record
                              Name                : String;
                              CreditType          : CreditCardType;
                              Prefix              : TCreditCardPrefix;
                              NumberLength        : TCredtCardLength;
                              Validation          : TCreditCardValidation;
                            end;
...
function PupolateRecord(aName       : String;                aCreditType   :
CreditCardType;
                        aPrefix     : Array of word;         aNumberLength :
Array of Word;
                        aValidation :
TCreditCardValidation                                    ) :
TNumberValidationRecord;
var
  i               : integer;
begin
  with Result do
    begin
     Name         := aName;
     CreditType   := aCreditType;
     SetLength(Prefix, High(aPrefix));
     SetLength(NumberLength, High(aNumberLength));
     for i := Low(aPrefix)       to High(aPrefix)       do Prefix[i]
:= aPrefix[i];
     for i := Low(aNumberLength) to High(aNumberLength) do NumberLength[i]
:= aNumberLength[i];
     validation   := aValidation;
    end;
end;

When I try to do the following:

RegisterCreditCard(PupolateRecord('MasterCard', cctMasterCard, [51..55],
[16], @validate));

The compiler crash with the following exception:

ppcx64 creditcard_validty.pp -Fu../luhn/
Free Pascal Compiler version 2.2.5 [2009/03/17] for x86_64
Copyright (c) 1993-2008 by Florian
Klaempfl
Target OS: Linux for
x86-64
Compiling
creditcard_validty.pp

Fatal: Compilation
aborted
An unhandled exception occurred at $00000000005591E2 :
EAbstractError : Abstract method
called

$00000000005591E2

$00000000005591E2

$000000000057C968

$000000000057C968

$000000000057C968

$000000000057C968

$000000000057DF64

$00000000005591E2

$000000000057DF64

$00000000005591E2

$00000000005591E2
$00000000005591E2
$00000000005591E2
$000000000052D9B6
$000000000052DDDB
$000000000052A1C1
$000000000052D205

Am I doing here something wrong (I think I can do better with coping between open and dynamic array) ?

Thanks,

Ido

Reply by email

Jonas Maebe
to ik
ik wrote
Am I doing here something wrong (I think I can do better with coping between open and dynamic array) ?

An unhandled exception in the compiler is always a compiler bug. Please submit a bug report with a compilable example that demonstrates the problem.

Jonas

Reply by email

JoshyFun
to ik: I'm using FPC from Arch Liunx. I'm trying to do the following code: ...…

Hello ik,

Saturday, April 4, 2009, 3:07:58 PM, you wrote:

i>      SetLength(Prefix, High(aPrefix));
i>      SetLength(NumberLength, High(aNumberLength));

Discarding the compiler crash, this code seems buggy to me, unless you know exactly the high/low of the arrays matches its length, I think it should look like:

SetLength(Prefix, Length(aPrefix));
SetLength(NumberLength, Length(aNumberLength));
Best regards, JoshyFun

Reply by email

ik
to Jonas Maebe: An unhandled exception in the compiler is always a compiler bug. Please submit a bug…

Jonas,

I can't reproduce it with a stand alone test (made many attempts). I can however place my original unit, because it is a LGPL unit I'm creating in the bug report, and see what is wrong there.
Will it be ok to do that in the bug report ?

Thanks,

Ido

Jonas Maebe wrote 17 lines
On 04 Apr 2009, at 15:07, ik wrote: Am I doing here something wrong (I think I can do better with coping > between > open and dynamic array) ? > An unhandled exception in the compiler is always a compiler bug. Please submit a bug report with a compilable example that demonstrates the problem. Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Jonas Maebe
to ik
ik wrote 5 lines
I can't reproduce it with a stand alone test (made many attempts). I can however place my original unit, because it is a LGPL unit I'm creating in the bug report, and see what is wrong there. Will it be ok to do that in the bug report ?

As long as you attach all necessary sources to the bug report (i.e., also other non-FPC units that it may require): sure!

Jonas

Reply by email