Skip to content

Commit 786f673

Browse files
kddnewtonmatzbot
authored andcommitted
[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. ruby/prism@fbe9b131a1
1 parent be12e19 commit 786f673

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prism/util/pm_constant_pool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ pm_constant_pool_insert(pm_constant_pool_t *pool, const uint8_t *start, size_t l
264264
// constant and replace it with the shared constant.
265265
xfree((void *) constant->start);
266266
constant->start = start;
267-
bucket->type = (unsigned int) (PM_CONSTANT_POOL_BUCKET_DEFAULT & 0x3);
267+
bucket->type = (unsigned int) (type & 0x3);
268268
}
269269

270270
return bucket->id;

0 commit comments

Comments
 (0)