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 77E266FC83; Thu, 30 Jun 2022 15:18:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 77E266FC83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1656591502; bh=Ol0hLtMNJSZaHf4tbESnS9jyYSQM0ETykqYyqDD4u/8=; 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=uYR3QyO2r17ZjAM3jeNnEPynhOoxjMUOFV6e8caf295+lf4REVEVu+P8d1SmjJsdd 4sG89+d/WOxB/vvXFaUEfOAWMZcQsGe0NEGibSDLW/ZgQkMZQ6gMMMH09hQLMSbJDQ Vmmx1U25/XqFReWArZtDlBgpgNKgl8phN2Pt9N3A= Received: from smtpng2.i.mail.ru (smtpng2.i.mail.ru [94.100.179.3]) (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 F3EAD6FC83 for ; Thu, 30 Jun 2022 15:17:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F3EAD6FC83 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1o6t6g-0005nS-6D; Thu, 30 Jun 2022 15:17:14 +0300 Date: Thu, 30 Jun 2022 15:10:03 +0300 To: Sergey Kaplun Message-ID: References: <20220127115346.22800-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220127115346.22800-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9F05DDD76985F9126E1DDAE1C6EB0772846459A7F84F1DAA6182A05F5380850400C335472239F8DAA0F824FFDECDEA4CBB45F958FC9730D02E091150A4361F994 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE716FAD50E497B9C14EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AAEFEF2B38A4D0058638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D85C7DF37D84AC9547789F46B7004AC6D4117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B60CDF180582EB8FBA471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CD0F529D6CE73765543847C11F186F3C59DAA53EE0834AAEE X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: 9604B64F49C60606AD91A466A1DEF99B296C473AB1E14218C6CDE5D1141D2B1CF0FC9FF3B6FB18F866EBA4FF8F02978AADD15505F73F5029AD91A466A1DEF99B296C473AB1E14218B936CB490224F2464EEA7BD89490CAC0EDDA962BC3F61961 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3450C5E6D685282BA18F01FE1F93ED9EFAFD9544AF2C7FFC1245C125616070ADE7578880023CE867671D7E09C32AA3244C1F13A48F2E6B9342A2F48A9BF21A854F725D5B54B2FE4575927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojhvrbUd41KJlRH1I96T2SrA== X-Mailru-Sender: 689FA8AB762F7393CC2E0F076E87284ED0115174A26CC9A4665FB1AA591572D6A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Fix bytecode dump unpatching. 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, I've checked the patch into all long-term branches in tarantool/luajit and bumped a new version in master, 2.10 and 1.10. On 27.01.22, Sergey Kaplun wrote: > From: Mike Pall > > Reported by Christopher Oliver. > > (cherry picked from commit 20ac817a747cf8cab044ae81b09c08d23e34342b) > > When a compiled function with up-recursion RET bytecodes are patched to > JLOOP bytecode. During dump of those bytecodes they should be unpatched > to the original one. It is done by restoring the opcode by subtraction > the diff between JLOOP and ILOOP bytecodes. That gives the LOOP > bytecodes instead RET as expected. > > This patch fixes the bytecode unpatching via copy the original start > instruction, that was patched. > > Sergey Kaplun: > * added the description and the test for the problem > > Part of tarantool/tarantool#6548 > --- > > Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-noticket-wrong-bc-ret > Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-noticket-wrong-bc-ret-full-ci > Related issue: https://github.com/tarantool/tarantool/issues/6548 > > src/lj_bcwrite.c | 5 +---- > .../bc-jit-unpatching.test.lua | 22 +++++++++++++++++++ > 2 files changed, 23 insertions(+), 4 deletions(-) > create mode 100644 test/tarantool-tests/bc-jit-unpatching.test.lua > > -- > 2.34.1 > -- Best regards, IM