summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-18 14:25:43 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-18 14:25:43 +0000
commit2fdf83ba3ea4d29c93dab9d6c3396ff4f1ca4dac (patch)
tree3977f83963e795ba11d6748fbe73c86383a211d8
parentf9ead5978176ae424a194b9b7ba28c08c9dcac48 (diff)
merge revision(s) 61591: [Backport #14312]
iseq.c (rb_iseq_new_with_opt): handle the case where node is imemo_func git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--iseq.c4
-rw-r--r--version.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/iseq.c b/iseq.c
index ac92237f38..10cb6b9b5c 100644
--- a/iseq.c
+++ b/iseq.c
@@ -517,9 +517,11 @@ rb_iseq_new_with_opt(const NODE *node, VALUE name, VALUE path, VALUE realpath,
{
/* TODO: argument check */
rb_iseq_t *iseq = iseq_alloc();
+ const rb_code_range_t *code_range = NULL;
if (!option) option = &COMPILE_OPTION_DEFAULT;
- prepare_iseq_build(iseq, name, path, realpath, first_lineno, node ? &node->nd_loc : NULL, parent, type, option);
+ if (node && !imemo_type_p((VALUE)node, imemo_ifunc)) code_range = &node->nd_loc;
+ prepare_iseq_build(iseq, name, path, realpath, first_lineno, code_range, parent, type, option);
rb_iseq_compile_node(iseq, node);
finish_iseq_build(iseq);
diff --git a/version.h b/version.h
index b5e35184b7..34521b6a54 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.5.0"
#define RUBY_RELEASE_DATE "2018-02-18"
-#define RUBY_PATCHLEVEL 20
+#define RUBY_PATCHLEVEL 21
#define RUBY_RELEASE_YEAR 2018
#define RUBY_RELEASE_MONTH 2