From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <8eec1f5d6d08659ae6c574f2c6fe581b@caldo.demon.co.uk> To: 9fans@cse.psu.edu Subject: Re: [9fans] useful language extension, or no? From: forsyth@caldo.demon.co.uk MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Fri, 19 Jul 2002 19:35:48 +0100 Topicbox-Message-UUID: d30756c4-eaca-11e9-9e20-41e7f4b1d025 >>Ah - I see! It hadn't realised that the scope rules now included >>that sort of nesting. When did that happen? I guess I am going to >>have to trade in my much loved, dog eared K&R for a book on >>standard C one of these days... it's a gcc-specific extension (certainly implemented THAT way). >>Presumably $185 generates the instruction to load the frame pointer, >>and $233 creates the jump to the actual function. it's not the normal frame pointer but a static link pointer that allows the nested function's code to find the right frame instance for accessing variables in the lexically-containing function. it's because the implementation uses a static link that it has a problem. there is another technique that wouldn't. the dragon book has a reasonable discussion of the alternatives but doesn't actually discuss the variant that could have been used here to avoid the need for the trampoline crud (although it mentions it in a throwaway remark).