From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id D6B6B6E1EC; Tue, 24 Nov 2026 13:20:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D6B6B6E1EC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1795515632; bh=SGcOv/JuUu29H/Nv+hLftb0DqPa29BgbSUqYG0myiq8=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=b3DPMdrb+rBsctcLcERcaeGMlC1frcW76zpdYzjm9KaTnrwJVA8E4CrTCYgSEvOZB Z3u44p46W/DD6tRTcA7BHyoxjKLNFf6sW2v15yVaYUVI3pE7+/SUbWBUkDnC2Iny+E ln0jfIuG+JofebyAyfFAzUlX6gQ0YYB4wKCTMVSI= Received: from send276.i.mail.ru (send276.i.mail.ru [95.163.59.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5042E6E1EC for ; Tue, 24 Nov 2026 13:20:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5042E6E1EC Received: by exim-smtp-canary-10-7cf57c478c-7qld8 with esmtpa (envelope-from ) id 1xVndX-00000000DON-0AnQ; Tue, 24 Nov 2026 13:20:31 +0300 Message-ID: <4f2340ab-0c21-4070-b257-7deb4d7f3a07@tarantool.org> Date: Tue, 24 Nov 2026 13:20:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Sergey Kaplun References: <4a3e159dc353186f5ab439952190b83218e9cbf0.1795430601.git.skaplun@tarantool.org> <7c389fcd-976d-4471-9643-4d17d5a7ae8e@tarantool.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9DFC18640EC9820976CDFBD6935517BF85882A36D30432DB4182A05F5380850404C775BCC283D6F803DE06ABAFEAF67057DB97109B456BEC67A2B66AF6AE06C51FE495290C33621F9 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AC4684DF4EC4B256EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB5533756603DA5D6BE41EFC0D569D1B0EE22D91C3DFB8052B082D757C01C16B09F4725288389733CBF5DBD5E9D5E8D9A59859A8B64854413538E1713FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE70BB89B22BF4660DC731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A575D691B464FA76EB5002B1117B3ED69602232B5886B0724DB74D9144D44E4FCF823CB91A9FED034534781492E4B8EEAD14747542773C033FBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659EAE26366C270F784E122C93816D4595DFD519EED425B1ECF0855C7F8E1FA59DED7A43CA2C785F96FB8341EE9D5BE9A0A66826B6276B791A465EB7FC08521E4DDA607E6C3F7BB8D0A6536EB022892E5344C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXOcIETfglQORZ0zpDET4Zrk3igikrdHlWNL/MK52/Y/Ke+eya20PhEY= X-Mailru-Sender: 689FA8AB762F73937C9FA53A4753B313C9BAE2D9E0F76771FB4C0A5834611B927D97E028374519EAEF86D5F70DA33880E41E8EF7A07863ECB274557F927329BE2DDF8182D28ACDB545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/2] x86: Fix math.floor()/ceil() argument check. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey, Thanks for the fix. LGTM On 11/24/26 11:05, Sergey Kaplun wrote: > Hi, Sergey! > Thanks for the review! > See my answers below. > > Branch is force-pushed. > > On 23.11.26, Sergey Bronnikov wrote: >> Hi, Sergey! >> >> thanks for the patch! LGTM with minor comments. >> >> Sergey >> >> On 11/23/26 13:46, Sergey Kaplun wrote: > > >>> diff --git a/test/tarantool-tests/lj-1532-math-floor-ceil-argcheck.test.lua b/test/tarantool-tests/lj-1532-math-floor-ceil-argcheck.test.lua >>> new file mode 100644 >>> index 00000000..b9def637 >>> --- /dev/null >>> +++ b/test/tarantool-tests/lj-1532-math-floor-ceil-argcheck.test.lua >>> @@ -0,0 +1,36 @@ >>> +local tap = require('tap') >>> + >>> +-- Test file to demonstrate LuaJIT incorrect handling of no >>> +-- arguments for `math.ceil()`, `math.floor()` functions. >>> +-- See also:https://github.com/LuaJIT/LuaJIT/issues/1532. >>> + >>> +local test = tap.test('lj-1532-math-floor-ceil-argcheck') >>> + >>> +test:plan(2) >>> + >>> +-- A simple function to push a number value for `math.floor()`, >>> +-- `math.ceil()` to the Lua stack. >> In fact, a function can push a value for any function, not only >> `math.floor()` or `math.ceil()`. >> >> I would omit the comment at all. > I've just exmplained here that function must to push some value to the > stack to be used later as the dirty value for the aforementioned > functions. The comment about functions explains the returned value. > >>> +local function stack() >>> + return 1.2 >>> +end >>> + >>> +local function call_wp(f) >>> + stack() -- Push some value to the stack to mark the slot. >> nit: we usually put a comments before the line, isn't it? > Moved: > > =================================================================== > diff --git a/test/tarantool-tests/lj-1532-math-floor-ceil-argcheck.test.lua b/test/tarantool-tests/lj-1532-math-floor-ceil-argcheck.test.lua > index b9def637..a2a2fb80 100644 > --- a/test/tarantool-tests/lj-1532-math-floor-ceil-argcheck.test.lua > +++ b/test/tarantool-tests/lj-1532-math-floor-ceil-argcheck.test.lua > @@ -15,7 +15,8 @@ local function stack() > end > > local function call_wp(f) > - stack() -- Push some value to the stack to mark the slot. > + -- Push some value to the stack to mark the slot. > + stack() > -- Use non-inlined variant for function name in the error > -- message. > local res = f() > =================================================================== > >>> + -- Use non-inlined variant for function name in the error >>> + -- message. >>> + local res = f() >>> + return res >>> +end >>> + >>> +local function math_func_test(subtest, f) >>> + subtest:plan(2) >>> + local err, msg = pcall(call_wp, f) >>> + subtest:is(err, false, 'correct status for empty ' .. subtest.name) >>> + subtest:like(msg, "bad argument #1 to 'f' %(number expected, got no value%)", >>> + 'correct error message for empty ' .. subtest.name) >>> +end >>> + >>> +test:test('math.ceil', math_func_test, math.ceil) >>> +test:test('math.floor', math_func_test, math.floor) >>> + >>> +test:done(true)