Re: [ooc-compiler] Assignment of local procedures
Brought to you by:
mva
|
From: August K. <fus...@co...> - 2007-02-20 20:53:12
|
Michael van Acken skrev: > On 20/02/07, *August Karlstrom* <fus...@co... > <mailto:fus...@co...>> wrote: [...] > Standard Oberon-2 does not support closures but even if it did I think > the result should be "1". > > > Correct on both counts. gcc does some tricky things to get local > functions > to work via pointers, so the above code does not crash outright. > > And the result should be "1". > > Comments? [...] > One fix would be to assume that any call to any procedure might change > any local > variable if the address of a nested procedure is taken somewhere. The most obvious solution, I guess, is to just follow the Oberon-2 standard and disallow assignment of local procedures. August |