From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Sergey Kaplun <skaplun@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH luajit] Fix predict_next() in parser. Date: Thu, 24 Aug 2023 10:50:00 +0300 [thread overview] Message-ID: <25ed554e-e6f7-bc47-654c-1810dc64cbee@tarantool.org> (raw) In-Reply-To: <ZOTRdLEXmKoPbUnL@root> Hi, On 8/22/23 18:17, Sergey Kaplun wrote: <snipped> >>> + >>> +local res, err = pcall(res_f) >>> + >>> +test:ok(not res, 'loaded function not executed') >> it is not clear for me what for do you need checking result code. I >> would omit it. >> >> Feel free to ignore. > Added the following comment to avoid confusing (see the whole iterative > patch below): > > =================================================================== > diff --git a/test/tarantool-tests/lj-1033-fix-parsing-predict-next.test.lua b/test/tarantool-tests/lj-1033-fix-parsing-predict-next.test.lua > index 63998d8c..fed3ff6c 100644 > --- a/test/tarantool-tests/lj-1033-fix-parsing-predict-next.test.lua > +++ b/test/tarantool-tests/lj-1033-fix-parsing-predict-next.test.lua > @@ -3,10 +3,6 @@ local test = tap.test('lj-1033-fix-parsing-predict-next') > > test:plan(3) > > -local res_f = loadstring([[ > --- This local variable is necessary, because it emits `KPRI` > --- bytecode, with which the next `KPRI` bytecode will be merged. > --- > -- The resulting bytecode is the following: > -- > -- 0001 KNIL 0 1 > @@ -16,14 +12,18 @@ local res_f = loadstring([[ > -- > -- This MOV doesn't use any variable value from the stack, so the > -- attempt to get the name in `predict_next() leads to the crash. > +local res_f = loadstring([[ > +-- This local variable is necessary, because it emits `KPRI` > +-- bytecode, with which the next `KPRI` bytecode will be merged. > local _ > for _ in (nil):foo() do end > ]]) > > -test:ok(res_f, 'chunk loaded sucsessfully') > +test:ok(res_f, 'chunk loaded successfully') > > local res, err = pcall(res_f) > > +-- Check consistency with PUC Rio Lua 5.1 behaviour. > test:ok(not res, 'loaded function not executed') > test:like(err, 'attempt to index a nil value', 'correct error message') > > =================================================================== > > Branch is force-pushed. > Thanks! LGTM now. >> >>> +test:like(err, 'attempt to index a nil value', 'correct error message') >>> + >>> +test:done(true)
next prev parent reply other threads:[~2023-08-24 7:50 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-08-15 14:25 Sergey Kaplun via Tarantool-patches 2023-08-16 12:25 ` Maxim Kokryashkin via Tarantool-patches 2023-08-16 15:52 ` Sergey Kaplun via Tarantool-patches 2023-08-21 12:04 ` Sergey Bronnikov via Tarantool-patches 2023-08-22 15:17 ` Sergey Kaplun via Tarantool-patches 2023-08-24 7:50 ` Sergey Bronnikov via Tarantool-patches [this message] 2023-08-31 15:19 ` Igor Munkin via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=25ed554e-e6f7-bc47-654c-1810dc64cbee@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=sergeyb@tarantool.org \ --cc=skaplun@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH luajit] Fix predict_next() in parser.' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox