[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Unprepared Stack Top Increase
- From: Dong Feng <middle.fengdong@...>
- Date: Thu, 16 May 2013 17:30:30 +0800
2013/5/16 William Ahern <william@25thandclement.com>:
> On Wed, May 15, 2013 at 11:13:38PM -0700, William Ahern wrote:
>
> Also, it sounds a little bit like you're arguing for a belt+suspenders
> approach to defensive programming. Some programmers might disagree with that
> approach on principle, or in this particular context. There's no substitute
> for understanding and following the contract when modifying internal code,
> and there's no end to all the various assertions one could add in an attempt
> to mitigate harm from a bug. In fact, lua_checkstack would hide bugs
> regarding internal semantics.
>
>
Thank you very much. Actually I'm not an advocator of
(overly-)defensive programming, (e.g. I remove "if (p != NULL)" from
the code I maintain whenever it is justified).
In this case, the "EXTRA_STACK" is exactly the information I need. I
had checked lua_chectstack() but omitted the line using that constant.
And that's a justified "ground rule" of avoiding to check the stack in
this case. Thank you for pointing out the past thread.
Dong