Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2001-09

bugs in local procedure calling

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Aleksey V. Vaneev

Hello,

v1.1

Can't point exactly where it is, but if I have level 2 local procedure, its call traps. Level 1 executes okay.

There are also some inline; bugs... The unit HRC I've posted some time ago doesn't compile.

All that works in 1.0.5.

Best regards,
Aleksey

Reply by email

Jonas Maebe
to Aleksey V. Vaneev
Aleksey V. Vaneev wrote
Can't point exactly where it is, but if I have level 2 local procedure, its call traps. Level 1 executes okay.

If you can't give an example program, we can't fix it unfortunately.

There are also some inline; bugs... The unit HRC I've posted some time ago doesn't compile.

Could you send it to me personally?

Jonas

Reply by email

Pavel V. Ozerski
to Aleksey V. Vaneev: v1.1 Can't point exactly where it is, but if I have level 2 local procedure, its call…

hello,
unfortunately, I cannot test my assumption because I have no Delphi newer than 3.0, i.e. version which supports dynamic arrays. But I found sources developed for these new Delphi versions which contain followed constructions (I tried to write a small sample but cannot test it under modern Delphi):

{$ifdef fpc}
{$mode delphi}
{$endif}
var
 x:array of array of longint;
begin
 setlength(x,10,10);
 x[2,3]:=1;
end.

That is shown, that setlength procedure applied to dynamic arrays can have in Delphi different amount of parameters (depend on count of dimensions in array which is defined in array description (e.g., "array of array of ...). FPC 1.1 (built from 5.09 sources) cannot support these constructions, only 1D dynamic arrays are supported. If this improvement is planned then all is OK. But please don't forget this Delphi feature! May be, I could also help to introduce it (but I'm not sure that I will have free time now).

Sincerely, Pavel

Reply by email

Florian Klaempfl
to Pavel V. Ozerski
you wrote 26 lines
hello, unfortunately, I cannot test my assumption because I have no Delphi newer than 3.0, i.e. version which supports dynamic arrays. But I found sources developed for these new Delphi versions which contain followed constructions (I tried to write a small sample but cannot test it under modern Delphi): {$ifdef fpc} {$mode delphi} {$endif} var x:array of array of longint; begin setlength(x,10,10); x[2,3]:=1; end. That is shown, that setlength procedure applied to dynamic arrays can have in Delphi different amount of parameters (depend on count of dimensions in array which is defined in array description (e.g., "array of array of ...). FPC 1.1 (built from 5.09 sources) cannot support these constructions, only 1D dynamic arrays are supported. If this improvement is planned then all is OK. But please don't forget this Delphi feature! May be, I could also help to introduce it (but I'm not sure that I will have free time now).

I quite sure I implemented it, when implementing dynamic arrays. Maybe it has been destroyed when
rewriting the internal proc handling?!

Reply by email

Jonas Maebe
to Florian Klaempfl
Florian Klaempfl wrote 13 lines
> That is shown, that setlength procedure applied to dynamic arrays can > have in Delphi different amount of parameters > (depend on count of dimensions in array which is defined in array > description (e.g., "array of array of ...). > FPC 1.1 (built from 5.09 sources) cannot support these constructions, > only 1D dynamic arrays are supported. If this > improvement is planned then all is OK. But please don't forget this > Delphi feature! May be, I could also help to > introduce it (but I'm not sure that I will have free time now). I quite sure I implemented it, when implementing dynamic arrays. Maybe it has been destroyed when rewriting the internal proc handling?!

No, the setlength stuff hasn't been converted to it yet and the code is still there in first and second pass afaik. Maybe the parser only allows one parameter or so?

Jonas

Reply by email

Jonas Maebe
to Aleksey V. Vaneev
Aleksey V. Vaneev wrote
Hello, Here's the source that bugs...

Thanks, it's fixed. It was a problem with the register allocation when assigning one ansistring to another, causing the optimizer to generate wrong code.

Jonas

Reply by email