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

Static analyzer warning in Sprite::parseJSON() #1749

Merged
merged 1 commit into from
Jun 19, 2015

Conversation

kkaefer
Copy link
Member

@kkaefer kkaefer commented Jun 18, 2015

Caught by Xcode 7:

/path/to/mapbox-gl-native/src/mbgl/map/sprite.cpp
/path/to/mapbox-gl-native/src/mbgl/map/sprite.cpp:148:17: Function call argument is an uninitialized value
/path/to/mapbox-gl-native/src/mbgl/map/sprite.cpp:48:13: Calling 'Sprite::parseJSON'
/path/to/mapbox-gl-native/src/mbgl/map/sprite.cpp:120:1: Entered call from 'operator()'
/path/to/mapbox-gl-native/src/mbgl/map/sprite.cpp:130:75: Entering loop body
/path/to/mapbox-gl-native/src/mbgl/map/sprite.cpp:131:13: 'name' initialized to a garbage value
/path/to/mapbox-gl-native/src/mbgl/map/sprite.cpp:148:17: Function call argument is an uninitialized value

/cc @kkaefer

@1ec5 1ec5 added the bug label Jun 18, 2015
@kkaefer kkaefer self-assigned this Jun 18, 2015
@kkaefer
Copy link
Member

kkaefer commented Jun 18, 2015

@1ec5 can you confirm this fixes the analyzer warning in Xcode 7?

@1ec5
Copy link
Contributor Author

1ec5 commented Jun 18, 2015

@kkaefer Yes, these warnings are resolved. The remaining analyzer warnings are covered upstream by memononen/libtess2#19, angusj/polyclipping#134, and tonymillion/Reachability#103.

@kkaefer kkaefer force-pushed the 1749-uninitialized-value branch from bf59909 to 0f5ad29 Compare June 19, 2015 09:35
@kkaefer kkaefer merged commit 0f5ad29 into master Jun 19, 2015
@kkaefer kkaefer deleted the 1749-uninitialized-value branch June 19, 2015 10:30
@mb12
Copy link

mb12 commented Jul 6, 2015

@1ec5 Just wanted to share that I had an older repo (without these changes). There in I was getting incredibly long time (over a minute) in style destructor. It was showing up when switching styles (in the Android sample app). The issue happened only when I was trying with my style changes (minor changes over emerald-v7). It did not happen on iOS or with any of the bundled styles. The issue went away after I merged this specific change in sprite json parsing. Thanks a lot for fixing this.

@1ec5
Copy link
Contributor Author

1ec5 commented Jul 6, 2015

Glad to hear it, @mb12, although @kkaefer gets the credit for this one. I originally wrote up #1749 as an issue, then @kkaefer morphed it into a PR with his fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants