If mergeYupDown() has been called on a Field3D so that its yup_field and ydown_field pointers point to itself, then swapping it may cause a segfault. The problem is that the yup_field and ydown_field pointers are swapped, but continue to point to the original field. The check in the ~Field3D() destructor on whether to delete yup_field or ydown_field will then not skip the delete, and already-deleted memory will be deleted, causing a segfault.
@dschwoerer has a fix for this in 8eae21d of #956.
The issue is also fixed by #1345 which changes the implementation of mergeYupYdown().
If
mergeYupDown()has been called on aField3Dso that itsyup_fieldandydown_fieldpointers point to itself, then swapping it may cause a segfault. The problem is that theyup_fieldandydown_fieldpointers are swapped, but continue to point to the original field. The check in the~Field3D()destructor on whether to deleteyup_fieldorydown_fieldwill then not skip the delete, and already-deleted memory will be deleted, causing a segfault.@dschwoerer has a fix for this in 8eae21d of #956.
The issue is also fixed by #1345 which changes the implementation of
mergeYupYdown().