Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Static analyzer error in GeometryCollection::fixupPolygons and wagyu #15382

@friedbunny

Description

@friedbunny

As of cd12961, Xcode 10.3’s static analyzer finds the following error — @astojilj it looks like #15309 may fix this?

mapbox-gl-native/src/mbgl/tile/geometry_tile_data.cpp:45:9: Access to field 'maximum_bound' results in a dereference of a null pointer (loaded from variable 'last_maximum') (within a call to 'add_ring’)

  1. mapbox-gl-native/src/mbgl/tile/geometry_tile_data.cpp:44:27: Entering loop body
  2. mapbox-gl-native/src/mbgl/tile/geometry_tile_data.cpp:45:9: Calling 'wagyu::add_ring'
  3. mapbox-gl-native/vendor/wagyu/include/mapbox/geometry/wagyu/wagyu.hpp:47:5: Entered call from 'fixupPolygons'
  4. mapbox-gl-native/vendor/wagyu/include/mapbox/geometry/wagyu/wagyu.hpp:49:16: Calling 'add_linear_ring<int, int>'
  5. mapbox-gl-native/vendor/wagyu/include/mapbox/geometry/wagyu/build_local_minima_list.hpp:13:1: Entered call from 'wagyu::add_ring'
  6. mapbox-gl-native/vendor/wagyu/include/mapbox/geometry/wagyu/build_local_minima_list.hpp:18:63: Assuming the condition is false
  7. mapbox-gl-native/vendor/wagyu/include/mapbox/geometry/wagyu/build_local_minima_list.hpp:21:5: Calling 'add_ring_to_local_minima_list'
  8. mapbox-gl-native/vendor/wagyu/include/mapbox/geometry/wagyu/local_minimum_util.hpp:204:1: Entered call from 'add_linear_ring<int, int>'
  9. mapbox-gl-native/vendor/wagyu/include/mapbox/geometry/wagyu/local_minimum_util.hpp:208:9: Assuming the condition is false
  10. mapbox-gl-native/vendor/wagyu/include/mapbox/geometry/wagyu/local_minimum_util.hpp:216:5: 'last_maximum' initialized to a null pointer value
  11. mapbox-gl-native/vendor/wagyu/include/mapbox/geometry/wagyu/local_minimum_util.hpp:217:12: Assuming the condition is false
  12. mapbox-gl-native/vendor/wagyu/include/mapbox/geometry/wagyu/local_minimum_util.hpp:217:12: Loop body executed 0 times
  13. mapbox-gl-native/vendor/wagyu/include/mapbox/geometry/wagyu/local_minimum_util.hpp:296:33: Access to field 'maximum_bound' results in a dereference of a null pointer (loaded from variable 'last_maximum’)

/cc @alexshalamov @pozdnyakov

Metadata

Metadata

Assignees

No one assigned

    Labels

    CoreThe cross-platform C++ core, aka mbglarchivedArchived because of inactivitybugrendering

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions