From 89887711586d289db6fd013ffd8407d381992663 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 1 Oct 2021 14:35:17 -0700 Subject: Fix --- match.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/match.c b/match.c index b954cc3..811d96a 100644 --- a/match.c +++ b/match.c @@ -115,7 +115,7 @@ static void cache_save(match_ctx_t *ctx, const char *str, pat_t *pat, match_t *m cache_t *cache = ctx->cache; if (cache->occupancy+1 > 3*cache->size) { if (cache->size == MAX_CACHE_SIZE) { - size_t h = hash(m->start, m->pat->id) & (cache->size-1); + size_t h = hash(str, pat->id) & (cache->size-1); for (int quota = 2; cache->matches[h] && quota > 0; quota--) { cache_hit_t **last_home = &cache->matches[h]; while ((*last_home)->next) -- cgit v1.2.3