Skip to content

Commit 3691b53

Browse files
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.
1 parent 814fb6f commit 3691b53

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.3.461
1+
8.3.462

bplane/bpBins.c

+3
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,9 @@ BinArray *bpBinArrayBuild(Rect bbox,
567567
int numBins;
568568
int count;
569569

570+
/* Added by Tim, 2/19/2024 */
571+
/* This line is not supposed to be needed? */
572+
if ((!subbin) && ((int)elements & BT_ARRAY)) return NULL;
570573

571574
if(BPD) DumpRect("#### bpBinArrayBuild, TOP bbox= ", &bbox);
572575

bplane/bpEnum.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ bpEnumNextBin(BPEnum *bpe, bool inside)
305305
{
306306
BPStack *bps = bpe->bpe_top;
307307

308-
#ifdef PARANOID
308+
#ifdef BPARANOID
309309
ASSERT(bps,"bpEnumNextBin");
310310
ASSERT(!bpe->bpe_nextElement,"bpEnumNextBin");
311311
#endif

bplane/bpMain.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void BPAdd(BPlane *bp, void *element)
128128
"BPAdd, attempted during active enumerations");
129129

130130
/* element rect must be canonical! */
131-
#ifdef PARANOID
131+
#ifdef BPARANOID
132132
ASSERT(GeoIsCanonicalRect(r),"BPAdd, rect must be canonical.");
133133
#endif
134134

bplane/bpOpaque.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,23 @@ static __inline__ bool bpBinType(BinArray *ba, int i)
106106

107107
static __inline__ Element *bpBinList(BinArray *ba, int i)
108108
{
109-
#ifdef PARANOID
109+
#ifdef BPARANOID
110110
ASSERT(bpBinType(ba,i)==BT_LIST,"bpBinList");
111111
#endif
112112
return (Element *) ba->ba_bins[i];
113113
}
114114

115115
static __inline__ Element **bpBinListHead(BinArray *ba, int i)
116116
{
117-
#ifdef PARANOID
117+
#ifdef BPARANOID
118118
ASSERT(bpBinType(ba,i)==BT_LIST,"bpBinList");
119119
#endif
120120
return (Element **) &ba->ba_bins[i];
121121
}
122122

123123
static __inline__ BinArray *bpSubArray(BinArray *ba, int i)
124124
{
125-
#ifdef PARANOID
125+
#ifdef BPARANOID
126126
ASSERT(bpBinType(ba,i)==BT_ARRAY,"bpSubArray");
127127
#endif
128128
return (BinArray *) ((pointertype) ba->ba_bins[i] & ~BT_TYPE_MASK);

0 commit comments

Comments
 (0)