Skip to content
Snippets Groups Projects
Commit 481999ba authored by Dmitry Rodionov's avatar Dmitry Rodionov
Browse files

chore: fix unchecked func res warning

Warning:
Return value of function 'json_lexer_next_token', called at
key_def.c:222, is not checked, but it is usually checked for this
function (12/13).
parent 88f8cc4d
No related branches found
No related tags found
1 merge request!1060Remaining patches for stat analysis
diff --git a/src/box/lua/key_def.c b/src/box/lua/key_def.c diff --git a/src/box/key_def.c b/src/box/key_def.c
index a95431de2..e234415f8 100644 index c790e2fb1..af9b4dd16 100644
--- a/src/box/lua/key_def.c --- a/src/box/key_def.c
+++ b/src/box/lua/key_def.c +++ b/src/box/key_def.c
@@ -272,7 +272,8 @@ static int @@ -219,7 +219,9 @@ key_def_set_part_path(struct key_def *def, uint32_t part_no, const char *path,
lbox_key_def_gc(struct lua_State *L) struct json_token token;
{ json_lexer_create(&lexer, path + multikey_path_len,
struct key_def *key_def = luaT_check_key_def(L, 1); path_len - multikey_path_len, TUPLE_INDEX_BASE);
- assert(key_def != NULL); - json_lexer_next_token(&lexer, &token);
+ if (key_def == NULL) // assert + int rc = json_lexer_next_token(&lexer, &token);
+ panic("key_def == NULL in %s:%d", __FILE__, __LINE__); + if (rc != 0) // assert
key_def_delete(key_def); + panic("rc != 0 in %s:%d", __FILE__, __LINE__);
return 0; assert(token.type == JSON_TOKEN_ANY);
}
/* The rest of JSON path couldn't be multikey. */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment