summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--test/ruby/test_method.rb4
-rw-r--r--version.h6
-rw-r--r--vm_eval.c6
4 files changed, 16 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index df6716aba8..83aef3cd62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Jun 16 00:30:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (eval_string_with_cref): propagate absolute path from the
+ binding if it is given explicitly. patch by Gat (Dawid Janczak) at
+ [ruby-core:55123]. [Bug #8436]
+
Wed Jun 12 23:41:21 2013 NARUSE, Yui <naruse@ruby-lang.org>
* vm_insnhelper.c (vm_yield_setup_block_args): partially revert r41019.
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 1546e15107..688386774c 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -505,7 +505,9 @@ class TestMethod < Test::Unit::TestCase
def test___dir__
assert_instance_of String, __dir__
- assert_equal(File.dirname(__FILE__), __dir__)
+ assert_equal(File.dirname(File.realpath(__FILE__)), __dir__)
+ bug8436 = '[ruby-core:55123] [Bug #8436]'
+ assert_equal(__dir__, eval("__dir__", binding), bug8436)
end
def test_alias_owner
diff --git a/version.h b/version.h
index 5e309cceeb..1131b00b1e 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.0.0"
-#define RUBY_RELEASE_DATE "2013-06-13"
-#define RUBY_PATCHLEVEL 216
+#define RUBY_RELEASE_DATE "2013-06-16"
+#define RUBY_PATCHLEVEL 217
#define RUBY_RELEASE_YEAR 2013
#define RUBY_RELEASE_MONTH 6
-#define RUBY_RELEASE_DAY 13
+#define RUBY_RELEASE_DAY 16
#include "ruby/version.h"
diff --git a/vm_eval.c b/vm_eval.c
index a52ab21e81..a152a6990e 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1157,7 +1157,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
int state;
VALUE result = Qundef;
VALUE envval;
- rb_binding_t *bind = 0;
+ VALUE absolute_path = Qnil;
rb_thread_t *th = GET_THREAD();
rb_env_t *env = NULL;
rb_block_t block, *base_block;
@@ -1173,6 +1173,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
mild_compile_error = th->mild_compile_error;
TH_PUSH_TAG(th);
if ((state = TH_EXEC_TAG()) == 0) {
+ rb_binding_t *bind = 0;
rb_iseq_t *iseq;
volatile VALUE iseqval;
@@ -1183,6 +1184,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
if (strcmp(file, "(eval)") == 0 && bind->path != Qnil) {
file = RSTRING_PTR(bind->path);
line = bind->first_lineno;
+ absolute_path = rb_current_realfilepath();
}
}
else {
@@ -1210,7 +1212,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
/* make eval iseq */
th->parse_in_eval++;
th->mild_compile_error++;
- iseqval = rb_iseq_compile_on_base(src, rb_str_new2(file), INT2FIX(line), base_block);
+ iseqval = rb_iseq_compile_with_option(src, rb_str_new2(file), absolute_path, INT2FIX(line), base_block, Qnil);
th->mild_compile_error--;
th->parse_in_eval--;