aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-10-01 14:35:17 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-10-01 14:35:17 -0700
commit89887711586d289db6fd013ffd8407d381992663 (patch)
tree99d352fc89705e345243c8f07bc6d1df1db972c2
parent5f0a7a876ad3add4319eddb57eb7e4aed5ba57bc (diff)
Fix
-rw-r--r--match.c2
1 files changed, 1 insertions, 1 deletions
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)