<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi!<div class=""><br class=""></div><div class="">Thanks for the patch!</div><div class=""><br class=""></div><div class="">Unfortunately, the test doesn’t fail for me, using tarantool test:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/lj-695-ffi-vararg-call.test.lua ...................... ok</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua .......... ok</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua ................ ok</b></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/gh-6189-cur_L.test.lua ............................... ok</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/lj-418-assert-any-type.test.lua ...................... ok</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class="">The sources at the build time are:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #2fb41d" class="">void</span><span style="font-variant-ligatures: no-common-ligatures" class=""> LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd)</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">{</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  CTState *cts = ctype_ctsG(J2G(J));</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  CType *d, *ct = lj_ctype_rawref(cts, cdataV(&rd->argv[</span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class="">])->ctypeid);</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  </span><span style="font-variant-ligatures: no-common-ligatures; color: #c1651c" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> (ctype_isenum(ct->info)) ct = ctype_child(cts, ct);</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  </span><span style="font-variant-ligatures: no-common-ligatures; color: #c1651c" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> (ctype_isnum(ct->info) || ctype_iscomplex(ct->info)) {</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    </span><span style="font-variant-ligatures: no-common-ligatures; color: #c1651c" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> (ctype_isinteger_or_bool(ct->info) && ct->size <= </span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">4</span><span style="font-variant-ligatures: no-common-ligatures" class=""> &&</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">        !(ct->size == </span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">4</span><span style="font-variant-ligatures: no-common-ligatures" class=""> && (ct->info & CTF_UNSIGNED)))</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">      d = ctype_get(cts, CTID_INT32);</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    </span><span style="font-variant-ligatures: no-common-ligatures; color: #c1651c" class="">else</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">      d = ctype_get(cts, CTID_DOUBLE);</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    J->base[</span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class="">] = crec_ct_tv(J, d, </span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class="">, J->base[</span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class="">], &rd->argv[</span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class="">]);</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  } </span><span style="font-variant-ligatures: no-common-ligatures; color: #c1651c" class="">else</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    J->base[</span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class="">] = TREF_NIL;</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  }</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div>Means, test passess even without the patch.</div><div><br class=""></div><div>Sergos</div><div><br class=""><blockquote type="cite" class=""><div class="">On 19 Sep 2022, at 10:50, Maxim Kokryashkin <<a href="mailto:m.kokryashkin@tarantool.org" class="">m.kokryashkin@tarantool.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<div class=""><div class="">Hi, Sergey!</div><div class="">Thanks for the patch!</div><div class="">LGTM, except for a single nit below:</div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;" class=""><div class=""><br class="">When `tonumber()` is recorded (as a part of a trace) for cdata argument<br class="">can't be converted to number the `nil` value is recorded as the yielded<br class="">result. But without special check on trace for cdata type this nil will<br class="">be returned for another type of cdata that can be converted.</div></blockquote><div class="">The first sentence lacks commas and is completely unreadable.</div><div class="">I suggest the following fix:</div><div class="">| 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.</div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;" class=""><div class=""><br class="">This patch adds the corresponding check for recoding of failed cdata<br class="">conversions.</div></blockquote><div class="">Typo: s/recoding/recording</div><div class=""> </div><div class=""><snipped></div><div class=""><div class="">--<br class="">Best regards,</div><div class="">Maxim Kokryashkin</div></div><div class=""> </div></div>
</div></blockquote></div><br class=""></div></div></body></html>