lboasso / oberonc

An Oberon-07 compiler for the JVM
MIT License
147 stars 17 forks source link

Problem with reference parameter/typeguard combination #5

Closed KevinRH closed 6 years ago

KevinRH commented 6 years ago

Hi Luca,

The following module compiles but crashes on execution.

MODULE Hard;

    TYPE
        P0 = POINTER TO R0;
        P1 = POINTER TO R1;
        R0 = RECORD x: INTEGER END;
        R1 = RECORD (R0) y: INTEGER END;

    VAR
        p0: P0;
        p1: P1;

    PROCEDURE proc(VAR p1: P1);
    BEGIN p1.y := 4
    END proc;

BEGIN
    NEW(p1);
    p0 := p1;
    proc(p0(P1))
END Hard.

Kevin

lboasso commented 6 years ago

Thank you for reporting this bug! I'll find some time to fix it this week.

lboasso commented 6 years ago

Hi, I fixed the issue with this commit 270fe2e5f30604e1ebe0c1fd6c96d08634894a2f Please let me know if you find other bugs :)