Project

General

Profile

Bug #59

Acces Violation TRAP on trial to pass math array element as parameter

Added by Yaroslav Romanchenko 9 months ago. Updated 9 months ago.

Status:
New
Priority:
Normal
Category:
Compiler

Description

What is wrong with this code?
Passing element of an dynamic math array of fixed arrays as parameter leads to AV on execution.
AV happens on line

P('buf[0]: ', buf[0])

module M;
import
    Commands;
type
    Vec = array [4] of float64;
    Buf = array [*] of Vec;
procedure P(c : array of char; const a : array [*] of float64);
var i : size;
begin
    var context := Commands.GetContext();
    context.out.String(c);
    for i := 0 to len(a, 0) - 1 do
        context.out.FloatFix(a[i], 0, 5, 0);
        context.out.Char(20X)
    end;
    context.out.Ln;
    context.out.Update
end P;
procedure Q*();
var v : Vec; buf : Buf;
begin
    v := [1, 2, 3, 4];
    P('v: ', v);
    new(buf, 10);
    buf[0] := v;
    P('buf[0]: ', buf[0])
end Q;
end M.Q ~ 
System.Free M ~

History

#1 Updated by Felix Friedrich 9 months ago

Unfortunately, the combination of open arrays and static arrays provide some problems at the moment. This needs to be fixed with fundamental considerations of the concept.

#2 Updated by Felix Friedrich 9 months ago

  • Assignee changed from Florian Negele to Felix Friedrich

Also available in: Atom PDF