Hairy Pixels <generic...@gmail.com> schrieb am Sa., 10. Sep. 2022, 03:21:
> > > > On Sep 9, 2022, at 4:48 PM, Sven Barth <pascaldra...@googlemail.com> > wrote: > > > > How about you simply report such corruptions as bugs? I can always close > them as "not a bug" or duplicate if necessary. > > > > Well I thought the data may have been saved on the stack and thus lost > when the function exits. What is the expected behavior for passing these > outside of the calling scope? > Looking at your example again - I'm only on my phone currently - it's indeed your fault because the state passed to a nested function variable does *not* survive the stack frame it belongs to. That's where function references shine, because there the state *does* survive. Regards, Sven >
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal