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

ruby-changes:58044

From: Koichi <ko1@a...>
Date: Mon, 30 Sep 2019 14:28:46 +0900 (JST)
Subject: [ruby-changes:58044] 8ba48c1b85 (master): rb_method_attr_t::location should be 0 or others.

https://git.ruby-lang.org/ruby.git/commit/?id=8ba48c1b85

From 8ba48c1b8509bc52c2fc1f020990c8a3a8eca2c9 Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Mon, 30 Sep 2019 14:27:02 +0900
Subject: rb_method_attr_t::location should be 0 or others.

method_def_location() expects that rb_method_attr_t::location
is 0 (Qfalse) or not.

diff --git a/vm_method.c b/vm_method.c
index 38da273..1508b9a 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -285,10 +285,10 @@ the_location(void) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L285
     int line;
 
     if (!cfp) {
-        return Qnil;
+        return Qfalse;
     }
     else if (! (line = rb_vm_get_sourceline(cfp))) {
-        return Qnil;
+        return Qfalse;
     }
     else {
         VALUE loc = rb_ary_new3(2, rb_iseq_path(cfp->iseq), INT2FIX(line));
-- 
cgit v0.10.2


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

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