summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-22 07:32:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-22 07:32:52 +0000
commit03813f6dac06ffc24ca04cc308e28d926aed14b4 (patch)
treeaacde63ea2ada5a8bd4328878e062daea8f68422 /vm_eval.c
parent62b8b4df780da2e8d0e14cbdf0b7e324fbda53d3 (diff)
vm_eval.c: Check_TypedStruct
* vm_eval.c (eval_string_with_cref): check by Check_TypedStruct instead of rb_obj_is_kind_of. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/vm_eval.c b/vm_eval.c
index dfa26186f4..8351f7f869 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1202,8 +1202,8 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
VALUE absolute_path = Qnil;
if (scope != Qnil) {
- if (rb_obj_is_kind_of(scope, rb_cBinding)) {
- GetBindingPtr(scope, bind);
+ bind = Check_TypedStruct(scope, &ruby_binding_data_type);
+ {
envval = bind->env;
if (strcmp(file, "(eval)") != 0) {
absolute_path = rb_str_new_cstr(file);
@@ -1214,11 +1214,6 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
absolute_path = rb_current_realfilepath();
}
}
- else {
- rb_raise(rb_eTypeError,
- "wrong argument type %s (expected Binding)",
- rb_obj_classname(scope));
- }
GetEnvPtr(envval, env);
base_block = &env->block;
}