[core] Check all bucket dynamic_casts

A mismatch can occur when a layer changes from one type to another.
This commit is contained in:
John Firebaugh
2018-07-23 16:08:44 -07:00
parent cb714d57c5
commit 2bbc792060
15 changed files with 122 additions and 34 deletions

View File

@@ -56,8 +56,11 @@ void RenderCircleLayer::render(PaintParameters& parameters, RenderSource*) {
const bool pitchWithMap = evaluated.get<CirclePitchAlignment>() == AlignmentType::Map;
for (const RenderTile& tile : renderTiles) {
assert(dynamic_cast<CircleBucket*>(tile.tile.getBucket(*baseImpl)));
CircleBucket& bucket = *reinterpret_cast<CircleBucket*>(tile.tile.getBucket(*baseImpl));
auto bucket_ = dynamic_cast<CircleBucket*>(tile.tile.getBucket(*baseImpl));
if (!bucket_) {
continue;
}
CircleBucket& bucket = *bucket_;
const auto& paintPropertyBinders = bucket.paintPropertyBinders.at(getID());