Was given a use case by Carsten Wulff (github issue #289) that
fails in the bplane code for subcell binning. It is still not clear why this example causes a failure when the bplane code has been working for so long. However, simply checking for the BT_ARRAY bit at one additional point in the code prevents the crash condition and appears not to have caused any issue with the database.
This commit is contained in:
parent
814fb6f18d
commit
3691b53dde
|
|
@ -567,6 +567,9 @@ BinArray *bpBinArrayBuild(Rect bbox,
|
||||||
int numBins;
|
int numBins;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
|
/* Added by Tim, 2/19/2024 */
|
||||||
|
/* This line is not supposed to be needed? */
|
||||||
|
if ((!subbin) && ((int)elements & BT_ARRAY)) return NULL;
|
||||||
|
|
||||||
if(BPD) DumpRect("#### bpBinArrayBuild, TOP bbox= ", &bbox);
|
if(BPD) DumpRect("#### bpBinArrayBuild, TOP bbox= ", &bbox);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ bpEnumNextBin(BPEnum *bpe, bool inside)
|
||||||
{
|
{
|
||||||
BPStack *bps = bpe->bpe_top;
|
BPStack *bps = bpe->bpe_top;
|
||||||
|
|
||||||
#ifdef PARANOID
|
#ifdef BPARANOID
|
||||||
ASSERT(bps,"bpEnumNextBin");
|
ASSERT(bps,"bpEnumNextBin");
|
||||||
ASSERT(!bpe->bpe_nextElement,"bpEnumNextBin");
|
ASSERT(!bpe->bpe_nextElement,"bpEnumNextBin");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ void BPAdd(BPlane *bp, void *element)
|
||||||
"BPAdd, attempted during active enumerations");
|
"BPAdd, attempted during active enumerations");
|
||||||
|
|
||||||
/* element rect must be canonical! */
|
/* element rect must be canonical! */
|
||||||
#ifdef PARANOID
|
#ifdef BPARANOID
|
||||||
ASSERT(GeoIsCanonicalRect(r),"BPAdd, rect must be canonical.");
|
ASSERT(GeoIsCanonicalRect(r),"BPAdd, rect must be canonical.");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ static __inline__ bool bpBinType(BinArray *ba, int i)
|
||||||
|
|
||||||
static __inline__ Element *bpBinList(BinArray *ba, int i)
|
static __inline__ Element *bpBinList(BinArray *ba, int i)
|
||||||
{
|
{
|
||||||
#ifdef PARANOID
|
#ifdef BPARANOID
|
||||||
ASSERT(bpBinType(ba,i)==BT_LIST,"bpBinList");
|
ASSERT(bpBinType(ba,i)==BT_LIST,"bpBinList");
|
||||||
#endif
|
#endif
|
||||||
return (Element *) ba->ba_bins[i];
|
return (Element *) ba->ba_bins[i];
|
||||||
|
|
@ -114,7 +114,7 @@ static __inline__ Element *bpBinList(BinArray *ba, int i)
|
||||||
|
|
||||||
static __inline__ Element **bpBinListHead(BinArray *ba, int i)
|
static __inline__ Element **bpBinListHead(BinArray *ba, int i)
|
||||||
{
|
{
|
||||||
#ifdef PARANOID
|
#ifdef BPARANOID
|
||||||
ASSERT(bpBinType(ba,i)==BT_LIST,"bpBinList");
|
ASSERT(bpBinType(ba,i)==BT_LIST,"bpBinList");
|
||||||
#endif
|
#endif
|
||||||
return (Element **) &ba->ba_bins[i];
|
return (Element **) &ba->ba_bins[i];
|
||||||
|
|
@ -122,7 +122,7 @@ static __inline__ Element **bpBinListHead(BinArray *ba, int i)
|
||||||
|
|
||||||
static __inline__ BinArray *bpSubArray(BinArray *ba, int i)
|
static __inline__ BinArray *bpSubArray(BinArray *ba, int i)
|
||||||
{
|
{
|
||||||
#ifdef PARANOID
|
#ifdef BPARANOID
|
||||||
ASSERT(bpBinType(ba,i)==BT_ARRAY,"bpSubArray");
|
ASSERT(bpBinType(ba,i)==BT_ARRAY,"bpSubArray");
|
||||||
#endif
|
#endif
|
||||||
return (BinArray *) ((pointertype) ba->ba_bins[i] & ~BT_TYPE_MASK);
|
return (BinArray *) ((pointertype) ba->ba_bins[i] & ~BT_TYPE_MASK);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue