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 70B041628FC3; Mon, 2 Mar 2026 11:05:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 70B041628FC3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1772438716; bh=HYGAxSdRaSgflXO7eUiXQeuNXZB14mb0pwoYL2Ft/Fw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=cB51fIhXmO31RpgvCwEPJNAR2XBPzFmEZlDMHP+VH+HUktkN3SmZrUSQ84ndEvIcj vqLrgJhGCVMizlkqwIfXOH09HGoMfDiASGlt6YIuaiUwTQ/IBtPy9g7+HdzxwEHAsr khqRt46XZXiySUxza8TRsRtgOO2h+xa9MmC7o6Xc= Received: from send172.i.mail.ru (send172.i.mail.ru [95.163.59.11]) (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 B853F1628FC3 for ; Mon, 2 Mar 2026 11:04:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B853F1628FC3 Received: by exim-smtp-558f87dcd7-l5b52 with esmtpa (envelope-from ) id 1vwyGh-00000000FvH-2om2; Mon, 02 Mar 2026 11:04:43 +0300 To: Sergey Bronnikov Date: Mon, 2 Mar 2026 11:05:31 +0300 Message-ID: <07878e492b55e0fb788ff7b037c0a7bc1073934a.1772438261.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9FE49BA1A5307ACBFC7D8D992125A62E537CF4B7208FEE17B00894C459B0CD1B9989E9BBA7661427D411046492FDDF806A38B39B4AE5F9D6C77DCBF6A769AB32083DAA694144A5695 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE782A779A89F7D69B2C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6759CC434672EE6371C2A783ECEC0211ADC4224003CC836476D5A39DEEDB180909611E41BBFE2FEB2BFF9466025BC9FCD6F0032855ABEAF6C3B720C4B62AD462B47EBDCA10A3C9E0C19FA2833FD35BB23D9E625A9149C048EE33AC447995A7AD18F04B652EEC242312D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B3A703B70628EAD7BA471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FC0D0A6BC2F876C5B53AA81AA40904B5D9CF19DD082D7633A0C84D3B47A649675F3AA81AA40904B5D98AA50765F790063782B44B642D65F314D81D268191BDAD3D3666184CF4C3C14F3FC91FA280E0CE3D1A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F9FFED5BD9FB417555E1C53F199C2BB95B5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A5EB53A66C50761CC15002B1117B3ED6960D78A0F239B08B1FE99897350C7C491E823CB91A9FED034534781492E4B8EEAD69BF13FED57427F1C79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D6590EA864377F56A62313B8D4FBEF23E99FD4122F79EBA99B4571344117CA8DC1CDDB4796E27C38C272B8341EE9D5BE9A0A7F3F63C7C4525B42AFC2223F3B497BC9213DBB5855B7231D6536EB022892E5344C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVbwN8XFWZxQU/R2AGynbrCE= X-Mailru-Sender: 583F1D7ACE8F49BDD951BA70C165859E0A374EC7E68AAE4EE693A2F4CD4B1000E0C9E555264C7311E513CD79F0D32CD2F2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A84198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 1/2] Fix pointer check for non-GC64 mode. 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Mike Pall Thanks to Stefan Hett. (cherry picked from commit 471f8936cbd6aa80a937e375fe53ecadab93696a) This commit fixes the check for the pointer returned by the internal LuaJIT allocator. For non-GC64 mode, the accessible address range should fit in 31 bits due to VM (and JIT) restrictions. This commit fixes the check. Since it is just an assertion check, there are no tests added for the change. But this commit simplifies the reproducer for the next patch (although not required). Sergey Kaplun: * added the description for the problem Part of tarantool/tarantool#12134 --- src/lj_def.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lj_def.h b/src/lj_def.h index a5bca6b0..b06462fe 100644 --- a/src/lj_def.h +++ b/src/lj_def.h @@ -105,9 +105,10 @@ typedef unsigned int uintptr_t; #define checku16(x) ((x) == (int32_t)(uint16_t)(x)) #define checki32(x) ((x) == (int32_t)(x)) #define checku32(x) ((x) == (uint32_t)(x)) +#define checkptr31(x) (((uint64_t)(uintptr_t)(x) >> 31) == 0) #define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x)) #define checkptr47(x) (((uint64_t)(uintptr_t)(x) >> 47) == 0) -#define checkptrGC(x) (LJ_GC64 ? checkptr47((x)) : LJ_64 ? checkptr32((x)) :1) +#define checkptrGC(x) (LJ_GC64 ? checkptr47((x)) : LJ_64 ? checkptr31((x)) :1) /* Every half-decent C compiler transforms this into a rotate instruction. */ #define lj_rol(x, n) (((x)<<(n)) | ((x)>>(-(int)(n)&(8*sizeof(x)-1)))) -- 2.53.0