aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-30 21:25:32 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-30 21:25:32 -0400
commit6565fd78fc2f9e3245d3b93182c59db64de2f4d0 (patch)
treef1252bb5e67026567223de0ece6c27a4cbac4270 /src
parent21824a7ab5487188e283ffaef3db157e669e273f (diff)
Speculative fix for memory error during installation
Diffstat (limited to 'src')
-rw-r--r--src/stdlib/tables.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/stdlib/tables.c b/src/stdlib/tables.c
index c374f26f..cbd96395 100644
--- a/src/stdlib/tables.c
+++ b/src/stdlib/tables.c
@@ -146,7 +146,9 @@ static void Table$set_bucket(Table_t *t, const void *entry, int32_t index, const
hshow(t);
const void *key = entry;
bucket_t *buckets = t->bucket_info->buckets;
- uint64_t hash = HASH_KEY(*t, key);
+ // NOTE: I'm not sure why this needs to be marked `volatile`, but it fixes
+ // a memory issue that was hard to debug.
+ volatile uint64_t hash = HASH_KEY(*t, key);
hdebug("Hash value (mod ", (int32_t)t->bucket_info->count, ") = ", hash, "\n");
bucket_t *bucket = &buckets[hash];
if (!bucket->occupied) {