summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-16 17:40:00 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-16 17:40:00 +0000
commit6ff75042db1a68a23a133667b3a97c9ec23c131e (patch)
tree71b655e989f973dc4f1e2e08a63aeeb776e75956 /compile.c
parentc4fdd64fe03cc5fd99cd6eee10df9b660b46167d (diff)
downloadruby-6ff75042db1a68a23a133667b3a97c9ec23c131e.tar.gz
* compile.c, iseq.c, ruby.c, vm.c, vm_core.h, vm_eval.c: add absolute
path field into rb_iseq_t. The field contains a string representing a path to corresponding source file. or nil when the iseq is created from -e, stdin, eval, etc. This field is used for require_relative. [ruby-dev:40004] * load.c (rb_f_require_relative): add C implementation of require_relative. * prelude.rb (require_relative): get rid of Ruby implementation of require_relative. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 1db4e9c6b8..a89bccbc2f 100644
--- a/compile.c
+++ b/compile.c
@@ -169,6 +169,9 @@ PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
#define iseq_filename(iseq) \
(((rb_iseq_t*)DATA_PTR(iseq))->filename)
+#define iseq_filepath(iseq) \
+ (((rb_iseq_t*)DATA_PTR(iseq))->filepath)
+
#define NEW_ISEQVAL(node, name, type, line_no) \
new_child_iseq(iseq, node, name, 0, type, line_no)
@@ -917,7 +920,7 @@ new_child_iseq(rb_iseq_t *iseq, NODE *node,
VALUE ret;
debugs("[new_child_iseq]> ---------------------------------------\n");
- ret = rb_iseq_new_with_opt(node, name, iseq_filename(iseq->self), INT2FIX(line_no),
+ ret = rb_iseq_new_with_opt(node, name, iseq_filename(iseq->self), iseq_filepath(iseq->self), INT2FIX(line_no),
parent, type, iseq->compile_data->option);
debugs("[new_child_iseq]< ---------------------------------------\n");
iseq_add_mark_object(iseq, ret);