close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 15 years ago

Closed 15 years ago

#777 closed defect (fixed)

Fail storing instance of Class in oza

Reported by: Jorge Owned by: Víctor de Buen Remiro
Priority: highest Milestone: OOP Implementation
Component: OIS Version: 2.0.1
Severity: blocker Keywords:
Cc:

Description

If you execute the following code, an error ( Segmentation fault ) is produced in the last instruction when loading back the oza stored:

Class @B {
  Text name = "B";
  //Real a = 1;
  Text Print(Real void) { WriteLn( "Hola" ) }
};

Class @C {
  @B aB
};

Class @A
{
  @B aBinA;
  @C aCinA
};

@B instB;

@A instA =
  [[
    @B aBinA = instB;
    @C aCinA = [[ @B aB = instB ]]
  ]];

Real Ois.Store( [[ instA ]], "./test.oza" );

Set kk = Ois.Load( "./test.oza" );

if member 'Real a' is uncommented then the 'Segmentation fault' does not appear but another error is generated, like this:

<E>
ERROR: [1] OIS: 
Cannot load from OIS NameBlock aCinAdue to ascent Class a doesn't exist</E>
<E>
ERROR: [2] OIS: 
BOisLoader::ReadNextObject: NULL element of set </E>
<E>
ERROR: [3] OIS: 
BOisLoader::ReadNextObject: NULL element of set </E>

Change History (1)

comment:1 Changed 15 years ago by Víctor de Buen Remiro

Resolution: fixed
Status: newclosed

(In [1623]) Fixes #777

Note: See TracTickets for help on using tickets.