[Tarantool-patches] [PATCH luajit] Check frame size limit before returning to a lower frame.

Sergey Bronnikov sergeyb at tarantool.org
Wed Mar 13 16:03:34 MSK 2024


Sergey,

thanks for the fixes! LGTM

On 3/13/24 15:35, Sergey Kaplun wrote:
> Sergey,
> Thanks for the review!
> Fixed your comment and force-pushed the branch.
>
> On 13.03.24, Sergey Bronnikov wrote:
>> Sergey,
>>
>> LGTM with minor comment below.
>>
>> On 3/13/24 12:37, Sergey Kaplun wrote:
> <snipped>
>
>>> ===================================================================
>>> diff --git a/test/tarantool-tests/lj-1173-frame-limit-lower-frame.test.lua b/test/tarantool-tests/lj-1173-frame-limit-lower-frame.test.lua
>>> index 91e2c603..468462d2 100644
>>> --- a/test/tarantool-tests/lj-1173-frame-limit-lower-frame.test.lua
>>> +++ b/test/tarantool-tests/lj-1173-frame-limit-lower-frame.test.lua
>>> @@ -44,9 +44,11 @@ local LJ_MAX_JSLOTS = 250
>>>    -- `maxslot` (the first free slot) to 249. Hence, the JIT slots
>>>    -- are overflowing.
>>>    
>>> -local chunk = 'local uv = {key = 1}\n'
>>> -chunk = chunk .. 'return function()\n'
>>> -chunk = chunk .. 'local r = retf()\n'
>>> +local chunk = [[
>>> +local uv = {key = 1}
>>> +return function()
>>> +  local r = retf()
>>> +  ]]
>> here brackets are on a new line with indentation and below brackets on
>> the same line with code.
>>
>> looks inconsistently.
> I've used such indentation to create a human-readable chunk:
> | return function()
> |   local r = retf()
> |   uv.key, ..., uv_key = nil
> | end
> Instead of:
> | return function()
> |   local r = retf()
> | uv.key, ..., uv_key = nil
> | end
>
> Since nobody wants to read this chunk as is, I've removed 2 spaces to
> avoid confusion. See the iterative patch below. Branch is force-pushed.
>
> ===================================================================
> diff --git a/test/tarantool-tests/lj-1173-frame-limit-lower-frame.test.lua b/test/tarantool-tests/lj-1173-frame-limit-lower-frame.test.lua
> index b454003e..cfaecbce 100644
> --- a/test/tarantool-tests/lj-1173-frame-limit-lower-frame.test.lua
> +++ b/test/tarantool-tests/lj-1173-frame-limit-lower-frame.test.lua
> @@ -51,7 +51,7 @@ local chunk = [[
>   local uv = {key = 1}
>   return function()
>     local r = retf()
> -  ]]
> +]]
>   
>   -- Each `UGET` occupies 1 slot, `KNIL` occupies the same amount.
>   -- 1 slot is reserved (`r` variable), 1 pair is set outside the
> ===================================================================
>
>>>    
>>>    -- Each `UGET` occupies 1 slot, `KNIL` occupies the same amount.
>>>    -- 1 slot is reserved (`r` variable), 1 pair is set outside the
>>> @@ -56,8 +58,8 @@ chunk = chunk .. 'local r = retf()\n'
>>>    for _ = 1, LJ_MAX_JSLOTS / 2 - 2 do
>>>      chunk = chunk .. ('uv.key, ')
>>>    end
>>> -chunk = chunk .. 'uv.key = nil\n'
>>> -chunk = chunk .. 'end\n'
>>> +chunk = chunk .. [[uv.key = nil
>>> +end]]
>>>    
>>>    local get_func = assert(loadstring(chunk))
>>>    local function_max_framesize = get_func()
>>> ===================================================================
>>>
> <snipped>
>


More information about the Tarantool-patches mailing list