> On Apr 19, 2017, at 4:33 PM, Michael Van Canneyt <mich...@freepascal.org> 
> wrote:
> 
> Your reasoning contains a wrong assumption, namely that I is on the stack.
> 
> If I is a register variable, then it is not on the stack, and will be reset
> with each longjmp.

I thought all variables declared inside a function (like below) were “on the 
stack” and I don’t even know what a register variable is honestly. Is there a 
way to make my example work and not have “i” reset each jump by declaring it 
differently or is that the choice of the compiler?

procedure TCoroutine.Start;
var
        i: integer = 0;
begin
end;

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to