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

ruby-changes:39370

From: nobu <ko1@a...>
Date: Fri, 31 Jul 2015 21:35:13 +0900 (JST)
Subject: [ruby-changes:39370] nobu:r51451 (trunk): load.c: use rb_load_internal0

nobu	2015-07-31 21:34:54 +0900 (Fri, 31 Jul 2015)

  New Revision: 51451

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

  Log:
    load.c: use rb_load_internal0
    
    * load.c (rb_require_internal): use rb_load_internal0 not to raise
      a exception to be caught.

  Modified files:
    trunk/ChangeLog
    trunk/load.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51450)
+++ ChangeLog	(revision 51451)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jul 31 21:34:49 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* load.c (rb_require_internal): use rb_load_internal0 not to raise
+	  a exception to be caught.
+
 Thu Jul 30 13:19:54 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* variable.c (rb_const_get_0): warn deprecated constant reference.
Index: load.c
===================================================================
--- load.c	(revision 51450)
+++ load.c	(revision 51451)
@@ -1006,7 +1006,7 @@ rb_require_internal(VALUE fname, int saf https://github.com/ruby/ruby/blob/trunk/load.c#L1006
 	    else {
 		switch (found) {
 		  case 'r':
-		    rb_load_internal(path, 0);
+		    state = rb_load_internal0(th, path, 0);
 		    break;
 
 		  case 's':
@@ -1015,8 +1015,10 @@ rb_require_internal(VALUE fname, int saf https://github.com/ruby/ruby/blob/trunk/load.c#L1015
 		    rb_ary_push(ruby_dln_librefs, LONG2NUM(handle));
 		    break;
 		}
-		rb_provide_feature(path);
-		result = TAG_RETURN;
+		if (!state) {
+		    rb_provide_feature(path);
+		    result = TAG_RETURN;
+		}
 	    }
 	}
     }

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

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