mruby-compiler (merge_op_string): fix #6477

If two merging strings are the same and registered at the bottom of the
pool, we should not remove the slot from the pool.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-02-11 22:45:50 +09:00
parent e660e28a39
commit 4ea5510937
+1 -1
View File
@@ -870,7 +870,7 @@ merge_op_string(codegen_scope *s, uint16_t dst, uint16_t b1, uint16_t b2, const
off = b1;
realloc_pool_str(s, p1, len1+len2);
memcpy((void*)(p1->u.str+len1), (void*)p2->u.str, len2);
if (used == 0 && b2+1 == s->irep->plen) {
if (b1 != b2 && used == 0 && b2+1 == s->irep->plen) {
free_pool_str(s, p2);
}
break;