z505 / ofront

Automatically exported from code.google.com/p/ofront
0 stars 0 forks source link

Infinite recursion in OPC.Stars #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
MODULE KolObj;

TYPE
    TObj* = RECORD
        name-: POINTER TO ARRAY OF CHAR;
    END;

END KolObj.

stef@notebook:/$ ofront KolObj.Mod
KolObj.Mod  translating KolObj  new symbol file    391

MODULE KolSocket; IMPORT KolObj;

TYPE
  TAsyncSocket* = RECORD (KolObj.TObj) END;

END KolSocket.

stef@notebook:/$ ofront KolSocket.Mod
Segmentation fault

It's infinite recursion in OPC.Stars - in line:

  IF typ^.comp # DynArr THEN Stars (typ, openClause) END ;

Infinite recursion arise if variable pointers = 0. If change the line to:

  IF typ^.comp # DynArr THEN
    IF pointers # 0 THEN Stars (typ, openClause) END
  END ;

the recursion not arises.

Original issue reported on code.google.com by al...@bk.ru on 9 Jun 2015 at 1:08