Oberon Community Platform Forum

Development => Bug Report => Topic started by: darek on May 15, 2008, 09:13:28 AM



Title: Compiler TRAP
Post by: darek on May 15, 2008, 09:13:28 AM
Dear all,

I am not sure if this is a compiler bug. I could not compile the this module on WinAos system.


 
Code:

   MODULE pclDataIO;
IMPORT NbrCplx;
 

TYPE
cplx_vector*         = ARRAY [ * ]    OF NbrCplx.Complex; 
 
     
data_vector* = OBJECT

VAR signal         : cplx_vector; 
      signalSize    : LONGINT; 
      data_ready  : BOOLEAN; 

PROCEDURE & Init( sSize: LONGINT ); 
VAR i: INTEGER; 
BEGIN   
   signalSize := sSize;
   NEW( signal, signalSize); 
FOR i := 0  TO signalSize - 1  DO
    NbrCplx.Set (0.0, 0.0, signal[i]);
     END; 
END Init; 

PROCEDURE ClearData*; 
VAR i: INTEGER; 

BEGIN
               FOR i := 0  TO SELF.signalSize - 1  DO
                   NbrCplx.Set(0.0, 0.0, SELF.signal[i]);
                          END; 
END ClearData; 

END data_vector; 

END pclDataIO.

  ... and this is  what I got as a TRAP:

       [1] TRAP 8 PL 3 8  ASSERT failed WinAos 27.03.2008 (Revision 1120)
 CS:=0000001B DS:=00000023 ES:=00000023 SS:=00000023 PC=00416C22 ESI=0133F194 EDI=006084B0 ESP=0133F188 PID=00000000
 EAX=00007D00 EBX=00000034 ECX=00000000 EDX=006084C4 EBP=0133F1B0 FS:=0000003B GS:=00000000 TMR=07B35A71
 FLAGS: CPAzStIdo iopl0 {0..2, 4, 7, 9}
Process: 4400 run4400 2   58D2F0:Oberon.OberonLoopObj NIL {0, 28}
Modules.InsertProcOffsets pc=4458 [0000116AH]
  procTable=006081F8H  ptrTable=005E7878H  maxPtr=141  success=FALSE  i=0
  j=0  pos=1301  poslast=-1  newLen=0  num=221  newProcOffsets=00000000H
  newPtrOffsets=00000000H


Any ideas ?

Regards,
  Darek


Title: Re: Compiler TRAP
Post by: negelef on May 15, 2008, 09:17:26 AM
It works if you define the complex vector type to be a pointer to an array:

Code:
TYPE cplx_vector* = POINTER TO ARRAY OF NbrCplx.Complex;


Title: Re: Compiler TRAP
Post by: darek on May 15, 2008, 09:26:37 AM
Thanks for your answer  ;D
I think, this  is more fundamental question if this module can be compiled as it is  (using the newest extensions
for matrix computations).

Is the module correct from the language definition point of view ?


Regards,
  Darek