[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: What problems may occur if the restriction(i.e. l_alloc should not fail when shrinking the block) is broken?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 13 Aug 2020 15:59:16 -0300
> What problems may occur if the restriction(i.e. l_alloc should not
> fail when shrinking the block) is broken?
The usual problems that occur when an assumption in some code is
wrong: Algorithms do not work as expected, which may leave the program
in some inconsistent state, which may result in crashes, memory leaks,
wrong results, etc. As an example, see the function luaH_resize in file
lgc.c and figure out what happens if the call after the comment "shrink
array" raises an error and interrupts the resize.