<HTML><BODY><div>Hi!</div><div>Are you sure you are doing everything right?</div><div>I’ve tested the test case both on M1 and x86 platforms and it works perfectly fine.</div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>Best regards,</div><div>Maxim Kokryashkin</div></div></div><div> </div><div> </div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Вторник, 20 сентября 2022, 11:53 +03:00 от sergos <sergos@tarantool.org>:<br> <div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16636640240411006167_BODY"><div class="cl_671570"><div style="-webkit-nbsp-mode:space; line-break:after-white-space; word-wrap:break-word">Hi!<div> </div><div>Thanks for the patch!</div><div> </div><div>Unfortunately, the test doesn’t fail for me, using tarantool test:</div><div> </div><div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/lj-695-ffi-vararg-call.test.lua ...................... ok</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">/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="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures"><b>/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="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/gh-6189-cur_L.test.lua ............................... ok</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-tests/lj-418-assert-any-type.test.lua ...................... ok</span></div></div><div> </div><div>The sources at the build time are:</div><div> </div><div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures;color: #2fb41d">void</span><span style="font-variant-ligatures: no-common-ligatures"> LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd)</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">{</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">  CTState *cts = ctype_ctsG(J2G(J));</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">  CType *d, *ct = lj_ctype_rawref(cts, cdataV(&rd->argv[</span><span style="font-variant-ligatures: no-common-ligatures;color: #b42419">0</span><span style="font-variant-ligatures: no-common-ligatures">])->ctypeid);</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">  </span><span style="font-variant-ligatures: no-common-ligatures;color: #c1651c">if</span><span style="font-variant-ligatures: no-common-ligatures"> (ctype_isenum(ct->info)) ct = ctype_child(cts, ct);</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">  </span><span style="font-variant-ligatures: no-common-ligatures;color: #c1651c">if</span><span style="font-variant-ligatures: no-common-ligatures"> (ctype_isnum(ct->info) || ctype_iscomplex(ct->info)) {</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">    </span><span style="font-variant-ligatures: no-common-ligatures;color: #c1651c">if</span><span style="font-variant-ligatures: no-common-ligatures"> (ctype_isinteger_or_bool(ct->info) && ct->size <= </span><span style="font-variant-ligatures: no-common-ligatures;color: #b42419">4</span><span style="font-variant-ligatures: no-common-ligatures"> &&</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">        !(ct->size == </span><span style="font-variant-ligatures: no-common-ligatures;color: #b42419">4</span><span style="font-variant-ligatures: no-common-ligatures"> && (ct->info & CTF_UNSIGNED)))</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">      d = ctype_get(cts, CTID_INT32);</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">    </span><span style="font-variant-ligatures: no-common-ligatures;color: #c1651c">else</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">      d = ctype_get(cts, CTID_DOUBLE);</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">    J->base[</span><span style="font-variant-ligatures: no-common-ligatures;color: #b42419">0</span><span style="font-variant-ligatures: no-common-ligatures">] = crec_ct_tv(J, d, </span><span style="font-variant-ligatures: no-common-ligatures;color: #b42419">0</span><span style="font-variant-ligatures: no-common-ligatures">, J->base[</span><span style="font-variant-ligatures: no-common-ligatures;color: #b42419">0</span><span style="font-variant-ligatures: no-common-ligatures">], &rd->argv[</span><span style="font-variant-ligatures: no-common-ligatures;color: #b42419">0</span><span style="font-variant-ligatures: no-common-ligatures">]);</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">  } </span><span style="font-variant-ligatures: no-common-ligatures;color: #c1651c">else</span><span style="font-variant-ligatures: no-common-ligatures"> {</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">    J->base[</span><span style="font-variant-ligatures: no-common-ligatures;color: #b42419">0</span><span style="font-variant-ligatures: no-common-ligatures">] = TREF_NIL;</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">  }</span></div><div style="font-stretch:normal; line-height:normal; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px"><span style="font-variant-ligatures: no-common-ligatures">}</span></div><div> </div><div>Means, test passess even without the patch.</div><div> </div><div>Sergos</div><div> <div class="mail-quote-collapse"><blockquote type="cite"><div>On 19 Sep 2022, at 10:50, Maxim Kokryashkin <<a href="//e.mail.ru/compose/?mailto=mailto%3am.kokryashkin@tarantool.org">m.kokryashkin@tarantool.org</a>> wrote:</div> <div><div><div>Hi, Sergey!</div><div>Thanks for the patch!</div><div>LGTM, except for a single nit below:</div><blockquote style="border-left:1px solid #0857A6;margin:10px;padding:0 0 0 10px;"><div><br>When `tonumber()` is recorded (as a part of a trace) for cdata argument<br>can't be converted to number the `nil` value is recorded as the yielded<br>result. But without special check on trace for cdata type this nil will<br>be returned for another type of cdata that can be converted.</div></blockquote><div>The first sentence lacks commas and is completely unreadable.</div><div>I suggest the following fix:</div><div>| 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;"><div><br>This patch adds the corresponding check for recoding of failed cdata<br>conversions.</div></blockquote><div>Typo: s/recoding/recording</div><div> </div><div><snipped></div><div><div>--<br>Best regards,</div><div>Maxim Kokryashkin</div></div><div> </div></div></div></blockquote></div></div></div></div></div></div></div></div></div></blockquote><div> </div></BODY></HTML>