Spivoxity / obc-3

Oxford Oberon-2 compiler
38 stars 7 forks source link

Structural type equivalence leads to infinite loop in compiler #10

Closed Spivoxity closed 5 years ago

Spivoxity commented 5 years ago

This program causes the compiler to go into an infinite loop:

MODULE Assign;

TYPE t1 = ARRAY 2 OF POINTER TO t1;
  t2 = ARRAY 2 OF POINTER TO t2;

VAR x: t1; y: t2;

BEGIN
  x := y
END Assign.

Note that the types t1 and t2 are not name-equivalent, so the program is illegal. But they are structurally equivalent in one sense.

[Reported by Hristo Venev]

Spivoxity commented 5 years ago

Fixed in 3.0.3