From: sergos via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Maxim Kokryashkin <m.kokryashkin@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] FFI: Add tonumber() specialization for failed conversions.
Date: Tue, 20 Sep 2022 13:10:41 +0300 [thread overview]
Message-ID: <E10BA246-8C18-432B-9F47-EC570BE6528E@tarantool.org> (raw)
In-Reply-To: <1663667902.185627333@f160.i.mail.ru>
[-- Attachment #1: Type: text/plain, Size: 3566 bytes --]
First of all:
s.ostanevich@s-ostanevich2:~/workspaces/t.sergos % uname -a
Darwin s-ostanevich2 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64
Then I just built Tarantool with ninja:
Tarantool 2.11.0-entrypoint-494-gdc147ec91
Target: Darwin-x86_64-debug
Then I brought the test as a patch from the mail and run ninja test.
The output says the test passes, while sources contains no patch. Am I missing something?
Sergos
> On 20 Sep 2022, at 12:58, Maxim Kokryashkin <m.kokryashkin@tarantool.org> wrote:
>
> Hi!
> Are you sure you are doing everything right?
> I’ve tested the test case both on M1 and x86 platforms and it works perfectly fine.
> --
> Best regards,
> Maxim Kokryashkin
>
>
> Вторник, 20 сентября 2022, 11:53 +03:00 от sergos <sergos@tarantool.org>:
>
> Hi!
>
> Thanks for the patch!
>
> Unfortunately, the test doesn’t fail for me, using tarantool test:
>
> /Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/lj-695-ffi-vararg-call.test.lua ...................... ok
> /Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua .......... ok
> /Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua ................ ok
> /Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/gh-6189-cur_L.test.lua ............................... ok
> /Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/lj-418-assert-any-type.test.lua ...................... ok
>
> The sources at the build time are:
>
> void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd)
> {
> CTState *cts = ctype_ctsG(J2G(J));
> CType *d, *ct = lj_ctype_rawref(cts, cdataV(&rd->argv[0])->ctypeid);
> if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct);
> if (ctype_isnum(ct->info) || ctype_iscomplex(ct->info)) {
> if (ctype_isinteger_or_bool(ct->info) && ct->size <= 4 &&
> !(ct->size == 4 && (ct->info & CTF_UNSIGNED)))
> d = ctype_get(cts, CTID_INT32);
> else
> d = ctype_get(cts, CTID_DOUBLE);
> J->base[0] = crec_ct_tv(J, d, 0, J->base[0], &rd->argv[0]);
> } else {
> J->base[0] = TREF_NIL;
> }
> }
>
> Means, test passess even without the patch.
>
> Sergos
>
>> On 19 Sep 2022, at 10:50, Maxim Kokryashkin <m.kokryashkin@tarantool.org <x-msg://e.mail.ru/compose/?mailto=mailto%3am.kokryashkin@tarantool.org>> wrote:
>>
>> Hi, Sergey!
>> Thanks for the patch!
>> LGTM, except for a single nit below:
>>
>> When `tonumber()` is recorded (as a part of a trace) for cdata argument
>> can't be converted to number the `nil` value is recorded as the yielded
>> result. But without special check on trace for cdata type this nil will
>> be returned for another type of cdata that can be converted.
>> The first sentence lacks commas and is completely unreadable.
>> I suggest the following fix:
>> | When `tonumber()` is recorded (as a part of a trace) for a cdata argument that can't be converted to number, the `nil` value is | recorded as the yielded result.
>>
>> This patch adds the corresponding check for recoding of failed cdata
>> conversions.
>> Typo: s/recoding/recording
>>
>> <snipped>
>> --
>> Best regards,
>> Maxim Kokryashkin
>>
>
>
[-- Attachment #2: Type: text/html, Size: 14148 bytes --]
next prev parent reply other threads:[~2022-09-20 10:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-12 8:01 Sergey Kaplun via Tarantool-patches
2022-09-19 7:50 ` Maxim Kokryashkin via Tarantool-patches
2022-09-20 8:53 ` sergos via Tarantool-patches
2022-09-20 9:58 ` Maxim Kokryashkin via Tarantool-patches
2022-09-20 10:10 ` sergos via Tarantool-patches [this message]
2022-09-21 12:03 ` Sergey Kaplun via Tarantool-patches
2022-09-21 12:19 ` sergos via Tarantool-patches
2022-09-22 11:28 ` Sergey Kaplun via Tarantool-patches
2022-09-25 21:37 ` sergos via Tarantool-patches
2022-09-28 7:37 ` Sergey Kaplun via Tarantool-patches
2022-09-24 14:49 ` Sergey Kaplun via Tarantool-patches
2022-11-11 8:54 ` 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=E10BA246-8C18-432B-9F47-EC570BE6528E@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=m.kokryashkin@tarantool.org \
--cc=sergos@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH luajit] FFI: Add tonumber() specialization for failed conversions.' \
/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