[ruby/prism] Correct constant pool bucket type logic

When replacing an owned constant by a different type (constant or
shared) replace with the correct type instead of defaulting to
shared.

https://github.com/ruby/prism/commit/fbe9b131a1
This commit is contained in:
Kevin Newton 2025-12-05 15:17:09 -05:00 committed by git
parent be12e19856
commit 786f673938

View File

@ -264,7 +264,7 @@ pm_constant_pool_insert(pm_constant_pool_t *pool, const uint8_t *start, size_t l
// constant and replace it with the shared constant.
xfree((void *) constant->start);
constant->start = start;
bucket->type = (unsigned int) (PM_CONSTANT_POOL_BUCKET_DEFAULT & 0x3);
bucket->type = (unsigned int) (type & 0x3);
}
return bucket->id;