|
|
 | | From: | toby | | Subject: | Re: RISC and CISC glass jaws | | Date: | 8 Jan 2005 13:13:54 -0800 |
|
|
 | Nick Maclaren wrote: > ... it could be done without overhead for functions > that did not refer to variables in outer functions
I think that much is indeed obvious. But taking the address of an inner function that uses inner variables and invoking it outside of that activation context is a runtime error that must surely be fatal. Passing frame pointers makes no semantic difference; the frame simply doesn't exist. But again, ignorance is my disclaimer.
--Toby
|
|
 | | From: | Nick Maclaren | | Subject: | Re: RISC and CISC glass jaws | | Date: | 9 Jan 2005 10:39:39 GMT |
|
|
 | In article <1105218834.562540.156930@c13g2000cwb.googlegroups.com>, toby wrote: >Nick Maclaren wrote: >> ... it could be done without overhead for functions >> that did not refer to variables in outer functions > >I think that much is indeed obvious. But taking the address of an inner >function that uses inner variables and invoking it outside of that >activation context is a runtime error that must surely be fatal. >Passing frame pointers makes no semantic difference; the frame simply >doesn't exist. But again, ignorance is my disclaimer.
Yes. Many languages that allow that prevent such use, statically or otherwise - see the postings about Pascal.
Note that, even with solely parameters, there can be more than one enclosing function frame corresponding to the same function.
Regards, Nick Maclaren.
|
|
|