Skip to content

Commit

Permalink
Was given a use case by Carsten Wulff (github issue #289) that
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
RTimothyEdwards committed Feb 19, 2024
1 parent 814fb6f commit 3691b53
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.3.461
8.3.462
3 changes: 3 additions & 0 deletions bplane/bpBins.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,9 @@ BinArray *bpBinArrayBuild(Rect bbox,
int numBins;
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);

Expand Down
2 changes: 1 addition & 1 deletion bplane/bpEnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ bpEnumNextBin(BPEnum *bpe, bool inside)
{
BPStack *bps = bpe->bpe_top;

#ifdef PARANOID
#ifdef BPARANOID
ASSERT(bps,"bpEnumNextBin");
ASSERT(!bpe->bpe_nextElement,"bpEnumNextBin");
#endif
Expand Down
2 changes: 1 addition & 1 deletion bplane/bpMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void BPAdd(BPlane *bp, void *element)
"BPAdd, attempted during active enumerations");

/* element rect must be canonical! */
#ifdef PARANOID
#ifdef BPARANOID
ASSERT(GeoIsCanonicalRect(r),"BPAdd, rect must be canonical.");
#endif

Expand Down
6 changes: 3 additions & 3 deletions bplane/bpOpaque.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,23 @@ static __inline__ bool bpBinType(BinArray *ba, int i)

static __inline__ Element *bpBinList(BinArray *ba, int i)
{
#ifdef PARANOID
#ifdef BPARANOID
ASSERT(bpBinType(ba,i)==BT_LIST,"bpBinList");
#endif
return (Element *) ba->ba_bins[i];
}

static __inline__ Element **bpBinListHead(BinArray *ba, int i)
{
#ifdef PARANOID
#ifdef BPARANOID
ASSERT(bpBinType(ba,i)==BT_LIST,"bpBinList");
#endif
return (Element **) &ba->ba_bins[i];
}

static __inline__ BinArray *bpSubArray(BinArray *ba, int i)
{
#ifdef PARANOID
#ifdef BPARANOID
ASSERT(bpBinType(ba,i)==BT_ARRAY,"bpSubArray");
#endif
return (BinArray *) ((pointertype) ba->ba_bins[i] & ~BT_TYPE_MASK);
Expand Down

0 comments on commit 3691b53

Please # to comment.