Closed SignumTemporis closed 2 years ago
It behaves the same way with global variable.
uses crt;
var
t: array [0..1] of Byte;
k: Byte;
procedure DoSomething();
var x1, x2: Byte;
begin
x1 := t[k];
// WriteLn(''); // (1)
k := k + 1;
x2 := t[k];
WriteLn(x1, ' ', x2);
end;
begin
t[0] := 1;
t[1] := 3;
k := 0;
DoSomething();
ReadKey();
end.
fixed
Works for me now.
Issue description
An index variable is not incremented without calling some procedure first (line
(1)
in sample code). When line(1)
is uncommented then it works as expected.For FPC -MDelphi v3.2.2 it works as expected.
Mad-Pascal Compiler version ece71f6 Mad-Assembler version 40bfd80
Code to reproduce the issue
Output
Expected
Actual