Skip to content

Commit de22bfc

Browse files
committed
Replaced defined(FORCE_INIT_OF_VARS) with UNINIT_VAR().
Better to avoid #ifdef in the main code if possible.
1 parent 536703e commit de22bfc

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

sql/item_jsonfunc.cc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,17 +1727,14 @@ bool Item_func_json_contains_path::val_bool()
17271727
uint n_arg;
17281728
longlong result;
17291729
json_path_t p;
1730-
int n_found;
1731-
int array_sizes[JSON_DEPTH_LIMIT];
1732-
uint has_negative_path= 0;
1733-
#if defined(FORCE_INIT_OF_VARS)
17341730
/*
1735-
Initialization force not required after gcc 13.3
1736-
where it correctly sees that an uninitialized read
1737-
of n_found doesn't occur with mode_one being true.
1731+
Initialization force not required after gcc 13.3 where it
1732+
correctly sees that an uninitialized read of n_found doesn't occur
1733+
with mode_one being true.
17381734
*/
1739-
n_found= 0;
1740-
#endif
1735+
int UNINIT_VAR(n_found);
1736+
int array_sizes[JSON_DEPTH_LIMIT];
1737+
uint has_negative_path= 0;
17411738

17421739
if ((null_value= args[0]->null_value))
17431740
return 0;

0 commit comments

Comments
 (0)