From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp16.mail.ru (smtp16.mail.ru [94.100.176.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 7FA60445320 for ; Mon, 13 Jul 2020 12:51:14 +0300 (MSK) Date: Mon, 13 Jul 2020 12:51:13 +0300 From: Sergey Bronnikov Message-ID: <20200713095113.GB80670@pony.bronevichok.ru> References: <7b82ce9d-9840-f98a-6d99-38afdeac68d9@tarantool.org> <20200710165535.GA80670@pony.bronevichok.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH 5/6] Fix luacheck warnings in src/lua/ List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: alexander.turenko@tarantool.org, tarantool-patches@dev.tarantool.org On 17:37 Sun 12 Jul , Vladislav Shpilevoy wrote: > On 10.07.2020 18:55, Sergey Bronnikov wrote: > > On 18:28 Sun 05 Jul , Vladislav Shpilevoy wrote: > >>> diff --git a/src/lua/msgpackffi.lua b/src/lua/msgpackffi.lua > >>> index f01ffaef0..cb7ad5b88 100644 > >>> --- a/src/lua/msgpackffi.lua > >>> +++ b/src/lua/msgpackffi.lua > >>> @@ -603,7 +599,7 @@ local function check_offset(offset, len) > >>> if offset == nil then > >>> return 1 > >>> end > >>> - local offset = ffi.cast('ptrdiff_t', offset) > >>> + offset = ffi.cast('ptrdiff_t', offset) > >> > >> Unnecessary diff. > > > > Reverted in a branch. > > > >>> if offset < 1 or offset > len then > >>> error(string.format("offset = %d is out of bounds [1..%d]", > >>> tonumber(offset), len)) > > Looks like it is not. I still see it on the branch. > https://github.com/tarantool/tarantool/blob/ligurio/gh-4681-fix-luacheck-warnings-src/src/lua/msgpackffi.lua#L602 It was not, because branch was not pushed to remote. Now fix is in a remote branch: local function check_offset(offset, len) if offset == nil then return 1 end local offset = ffi.cast('ptrdiff_t', offset) if offset < 1 or offset > len then error(string.format("offset = %d is out of bounds [1..%d]", tonumber(offset), len)) end return offset end