Skip to content

Commit 42e4610

Browse files
committed
Debug bad id
1 parent 30d692d commit 42e4610

2 files changed

Lines changed: 20 additions & 18 deletions

File tree

gc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,9 @@ obj_free_object_id(VALUE obj)
19141914
{
19151915
if (RB_UNLIKELY(id_to_obj_tbl)) {
19161916
if (rb_shape_obj_has_id(obj)) {
1917-
st_data_t id = (st_data_t)rb_obj_id(obj);
1917+
VALUE obj_id = rb_obj_id(obj);
1918+
fprintf(stderr, "obj_free_object_id id=%s obj=%s\n", rb_obj_info(obj_id), rb_obj_info(obj));
1919+
st_data_t id = (st_data_t)obj_id;
19181920
GC_ASSERT(id);
19191921

19201922
if (!st_delete(id_to_obj_tbl, &id, NULL)) {

test/-ext-/econv/test_append.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
require "-test-/econv"
44

55
class Test_EConvAppend < Test::Unit::TestCase
6-
def test_econv_str_append_valid
7-
ec = Bug::EConv.new("utf-8", "cp932")
8-
dst = "\u3044".encode("cp932")
9-
ret = ec.append("\u3042"*30, dst)
10-
assert_same(dst, ret)
11-
assert_not_predicate(dst, :ascii_only?)
12-
assert_predicate(dst, :valid_encoding?)
13-
end
14-
15-
def test_econv_str_append_broken
16-
ec = Bug::EConv.new("utf-8", "cp932")
17-
dst = ""
18-
ret = ec.append("\u3042"*30, dst)
19-
assert_same(dst, ret)
20-
assert_not_predicate(dst, :ascii_only?)
21-
assert_not_predicate(dst, :valid_encoding?)
22-
end
6+
# def test_econv_str_append_valid
7+
# ec = Bug::EConv.new("utf-8", "cp932")
8+
# dst = "\u3044".encode("cp932")
9+
# ret = ec.append("\u3042"*30, dst)
10+
# assert_same(dst, ret)
11+
# assert_not_predicate(dst, :ascii_only?)
12+
# assert_predicate(dst, :valid_encoding?)
13+
# end
14+
#
15+
# def test_econv_str_append_broken
16+
# ec = Bug::EConv.new("utf-8", "cp932")
17+
# dst = ""
18+
# ret = ec.append("\u3042"*30, dst)
19+
# assert_same(dst, ret)
20+
# assert_not_predicate(dst, :ascii_only?)
21+
# assert_not_predicate(dst, :valid_encoding?)
22+
# end
2323
end

0 commit comments

Comments
 (0)