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

ruby-changes:15904

From: yugui <ko1@a...>
Date: Sun, 16 May 2010 21:46:37 +0900 (JST)
Subject: [ruby-changes:15904] Ruby:r27846 (ruby_1_9_2): merges r27817 from trunk into ruby_1_9_2.

yugui	2010-05-16 21:46:17 +0900 (Sun, 16 May 2010)

  New Revision: 27846

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

  Log:
    merges r27817 from trunk into ruby_1_9_2.
    --
    * proc.c (proc_binding): don't propagative filename and line_no of
      binding that is created from C level.  [ruby-dev:41322]
    
    * vm_eval.c (eval_string_with_cref): ditto.

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/proc.c
    branches/ruby_1_9_2/vm_eval.c

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 27845)
+++ ruby_1_9_2/ChangeLog	(revision 27846)
@@ -1,3 +1,10 @@
+Sun May 16 17:16:09 2010  Yusuke Endoh  <mame@t...>
+
+	* proc.c (proc_binding): don't propagative filename and line_no of
+	  binding that is created from C level.  [ruby-dev:41322]
+
+	* vm_eval.c (eval_string_with_cref): ditto.
+
 Sun May 16 13:55:25 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* error.c (rb_loaderror): use locale string, not ascii-8bit.
Index: ruby_1_9_2/vm_eval.c
===================================================================
--- ruby_1_9_2/vm_eval.c	(revision 27845)
+++ ruby_1_9_2/vm_eval.c	(revision 27846)
@@ -966,7 +966,7 @@
 	    if (rb_obj_is_kind_of(scope, rb_cBinding)) {
 		GetBindingPtr(scope, bind);
 		envval = bind->env;
-		if (strcmp(file, "(eval)") == 0) {
+		if (strcmp(file, "(eval)") == 0 && bind->filename != Qnil) {
 		    file = RSTRING_PTR(bind->filename);
 		    line = bind->line_no;
 		}
Index: ruby_1_9_2/proc.c
===================================================================
--- ruby_1_9_2/proc.c	(revision 27845)
+++ ruby_1_9_2/proc.c	(revision 27846)
@@ -1897,8 +1897,14 @@
     bindval = binding_alloc(rb_cBinding);
     GetBindingPtr(bindval, bind);
     bind->env = proc->envval;
-    bind->filename = proc->block.iseq->filename;
-    bind->line_no = rb_iseq_first_lineno(proc->block.iseq);
+    if (RUBY_VM_NORMAL_ISEQ_P(proc->block.iseq)) {
+	bind->filename = proc->block.iseq->filename;
+	bind->line_no = rb_iseq_first_lineno(proc->block.iseq);
+    }
+    else {
+	bind->filename = Qnil;
+	bind->line_no = 0;
+    }
     return bindval;
 }
 

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

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