Spivoxity / obc-3

Oxford Oberon-2 compiler
38 stars 7 forks source link

Segmentation Fault: 11 at array access #19

Closed Spivoxity closed 5 years ago

Spivoxity commented 5 years ago

Christian Kleinert reported as follows.

The attached files compiled with obc version 3.0.5 (obc HeapProc.mod TestHeapProc.mod) on macOS 10.12.5 produce a Segmentation Fault at the commented lines in HeapProc.mod.

When storing the index for writing the array in a temporary variable it works.

(using .mod instead of .m only to satisfy the Visual Studio Code plugin)

Spivoxity commented 5 years ago

Confirmed on Linux/i386.

For diagnosis, see the attached test case tKleinert.m.

Workaround: make the array parameter to Generate a VAR parameter to remove the need to allocate space for a variable-sized copy in the stack frame.

[See tKleinert.m]

Spivoxity commented 5 years ago

Fixed in 3.0.6