[Tarantool-patches] [PATCH luajit 1/3] sysprof: fix interval parsing in dual-number mode

Maxim Kokryashkin m.kokryashkin at tarantool.org
Tue Jan 24 17:16:59 MSK 2023


Hi, Sergey!
Thanks for the patch!
LGTM
--
Best regards,
Maxim Kokryashkin
 
 
> 
>>When the profiling interval is parsed, `tvisnum()` is used to check that
>>the given value is a number. But in case of dual-number mode this check
>>returns false as far as the given value is an integer, so `tvisnumber()`
>>should be used to cover both cases.
>>---
>> src/lib_misc.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>diff --git a/src/lib_misc.c b/src/lib_misc.c
>>index 06fb9f9f..c18d297e 100644
>>--- a/src/lib_misc.c
>>+++ b/src/lib_misc.c
>>@@ -209,7 +209,7 @@ static int parse_sysprof_opts(lua_State *L, struct luam_Sysprof_Options *opt, in
>>   {
>>     cTValue *interval = lj_tab_getstr(options, lj_str_newlit(L, "interval"));
>>     opt->interval = SYSPROF_DEFAULT_INTERVAL;
>>- if (interval && tvisnum(interval)) {
>>+ if (interval && tvisnumber(interval)) {
>>       int32_t signed_interval = numberVint(interval);
>>       if (signed_interval < 1)
>>         return PROFILE_ERRUSE;
>>--
>>2.34.1
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20230124/0d69497d/attachment.htm>


More information about the Tarantool-patches mailing list