diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-09-23 12:27:56 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-09-23 12:27:56 +0300 |
commit | af40a2b43e94cab6b25c9efe4b18c3112b4a9e6c (patch) | |
tree | a34a0afceb3e55d3f7c434eee457a86daa663eb5 /sql/item_geofunc.cc | |
parent | 0448558a0dd88c8031b66a9ea0296ee05b6333d3 (diff) | |
download | mariadb-git-af40a2b43e94cab6b25c9efe4b18c3112b4a9e6c.tar.gz |
Fix GCC 10.2.0 -Og -fsanitize=undefined -Wmaybe-uninitialized
For some reason, adding -fsanitize=undefined (cmake -DWITH_UBSAN=ON)
to the compilation flags will cause even more warnings to be emitted.
The warnings do look bogus, but the code can be simplified.
Diffstat (limited to 'sql/item_geofunc.cc')
-rw-r--r-- | sql/item_geofunc.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 0db8d7075f6..1c3fafc0582 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2003, 2016, Oracle and/or its affiliates. - Copyright (c) 2011, 2016, MariaDB + Copyright (c) 2011, 2020, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -456,16 +456,18 @@ String *Item_func_boundary::val_str(String *str_value) DBUG_ASSERT(fixed == 1); String arg_val; String *swkb= args[0]->val_str(&arg_val); + + if ((null_value= args[0]->null_value)) + DBUG_RETURN(0); + Geometry_buffer buffer; - Geometry *g; uint32 srid= 0; Transporter trn(&res_receiver); - - if ((null_value= - args[0]->null_value || - !(g= Geometry::construct(&buffer, swkb->ptr(), swkb->length())))) + + Geometry *g= Geometry::construct(&buffer, swkb->ptr(), swkb->length()); + if (!g) DBUG_RETURN(0); - + if (g->store_shapes(&trn)) goto mem_error; |