After proper instrumentation, it appears that a reproducible crash case provided by Stephane Rollandin is due to attempt of removing a face which is not in the fillList. This happens in the special case when `leftEdge == lastIntersection`, and the code attempts to remove `leftEdge->rightFace` which seem to not always be on the fillList. It's not obvious to understand if this is really an invariant of the loop, or a wrong expectation. Thus, as a workaround, protect the removal by a preliminary inclusion test.
Note that removing or adding a face should change its `B3D_FACE_ACTIVE` flags. Normally, we remove then add, so do not have to toggle the flag. But if we do not remove, then we must toggle, otherwise another invariant will break and cause crash in `b3dToggleTopFills`.
Want to know about upcoming build environment updates?
Would you like to stay up-to-date with the upcoming Travis CI build environment updates? We set up a mailing list for you!