Ticket #838: clear-hint.patch

File clear-hint.patch, 825 bytes (added by Olly Betts, 6 weeks ago)

Patch to clear the hint

  • xapian-core/matcher/queryoptimiser.h

    diff --git a/xapian-core/matcher/queryoptimiser.h b/xapian-core/matcher/queryoptimiser.h
    index 5ca302a00a0c..9a1b520530b2 100644
    a b class QueryOptimiser {  
    158158
    159159    void destroy_postlist(PostList* pl) {
    160160        if (!pl) return;
    161         if (pl == static_cast<PostList*>(hint)) {
    162             hint_owned = true;
    163         } else {
    164             if (!hint_owned) {
    165                 // The hint could be a subpostlist of pl, but we can't easily
    166                 // tell so we have to do the safe thing and reset it.
    167                 //
    168                 // This isn't ideal, but it's much better than use-after-free
    169                 // bugs.
    170                 hint = nullptr;
    171             }
    172             delete pl;
    173         }
     161        set_hint_postlist(nullptr);
    174162        // Remove the EstimateOp (and any sub-ops) which we generated for this
    175163        // PostList.
    176164        localsubmatch.pop_op();