[前][次][番号順一覧][スレッド一覧]

ruby-changes:54074

From: nobu <ko1@a...>
Date: Sun, 9 Dec 2018 10:34:29 +0900 (JST)
Subject: [ruby-changes:54074] nobu:r66293 (trunk): raise instead of rb_bug

nobu	2018-12-09 10:34:23 +0900 (Sun, 09 Dec 2018)

  New Revision: 66293

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66293

  Log:
    raise instead of rb_bug

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 66292)
+++ compile.c	(revision 66293)
@@ -627,7 +627,9 @@ rb_iseq_compile_node(rb_iseq_t *iseq, co https://github.com/ruby/ruby/blob/trunk/compile.c#L627
     DECL_ANCHOR(ret);
     INIT_ANCHOR(ret);
 
-    VM_ASSERT(!imemo_type_p((VALUE)node, imemo_ifunc));
+    if (imemo_type_p((VALUE)node, imemo_ifunc)) {
+        rb_raise(rb_eArgError, "unexpected imemo_ifunc");
+    }
 
     if (node == 0) {
 	COMPILE(ret, "nil", node);
@@ -9280,8 +9282,9 @@ NORETURN(static void ibf_dump_object_uns https://github.com/ruby/ruby/blob/trunk/compile.c#L9282
 static void
 ibf_dump_object_unsupported(struct ibf_dump *dump, VALUE obj)
 {
-    rb_obj_info_dump(obj);
-    rb_bug("ibf_dump_object_unsupported: unsupported");
+    char buff[0x100];
+    rb_raw_obj_info(buff, sizeof(buff), obj);
+    rb_raise(rb_eNotImpError, "ibf_dump_object_unsupported: %s", buff);
 }
 
 static VALUE
@@ -9493,7 +9496,8 @@ ibf_dump_object_struct(struct ibf_dump * https://github.com/ruby/ruby/blob/trunk/compile.c#L9496
 	IBF_WV(range);
     }
     else {
-	rb_bug("ibf_dump_object_struct: unsupported class");
+        rb_raise(rb_eNotImpError, "ibf_dump_object_struct: unsupported class %"PRIsVALUE,
+                 rb_class_name(CLASS_OF(obj)));
     }
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]