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

ruby-changes:4343

From: ko1@a...
Date: Mon, 24 Mar 2008 20:10:12 +0900 (JST)
Subject: [ruby-changes:4343] knu - Ruby:r15833 (ruby_1_8): * eval.c (rb_eval): Call trace hook for if expression after the

knu	2008-03-24 20:09:51 +0900 (Mon, 24 Mar 2008)

  New Revision: 15833

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/eval.c

  Log:
    * eval.c (rb_eval): Call trace hook for if expression after the
      condition has been evaluated, not before; submitted by Rocky
      Bernstein in #18722.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=15833&r2=15832&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/eval.c?r1=15833&r2=15832&diff_format=u

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 15832)
+++ ruby_1_8/ChangeLog	(revision 15833)
@@ -1,3 +1,9 @@
+Mon Mar 24 20:07:42 2008  Akinori MUSHA  <knu@i...>
+
+	* eval.c (rb_eval): Call trace hook for if expression after the
+	  condition has been evaluated, not before; submitted by Rocky
+	  Bernstein in #18722.
+
 Mon Mar 24 19:44:53 2008  Akinori MUSHA  <knu@i...>
 
 	* parse.y (yycompile): Always prepare a new array for each file's
Index: ruby_1_8/eval.c
===================================================================
--- ruby_1_8/eval.c	(revision 15832)
+++ ruby_1_8/eval.c	(revision 15833)
@@ -3038,13 +3038,16 @@
 	RETURN(Qfalse);
 
       case NODE_IF:
-	EXEC_EVENT_HOOK(RUBY_EVENT_LINE, node, self,
-			ruby_frame->last_func,
-			ruby_frame->last_class);
 	if (RTEST(rb_eval(self, node->nd_cond))) {
+	    EXEC_EVENT_HOOK(RUBY_EVENT_LINE, node, self,
+			    ruby_frame->last_func,
+			    ruby_frame->last_class);
 	    node = node->nd_body;
 	}
 	else {
+	    EXEC_EVENT_HOOK(RUBY_EVENT_LINE, node, self,
+			    ruby_frame->last_func,
+			    ruby_frame->last_class);
 	    node = node->nd_else;
 	}
 	goto again;

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

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