summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/iseq.c b/iseq.c
index 01d2e74..f553720 100644
--- a/iseq.c
+++ b/iseq.c
@@ -479,11 +479,10 @@ rb_iseq_new_with_opt(NODE *node, VALUE name, VALUE path, VALUE absolute_path,
const rb_iseq_t *
rb_iseq_load_iseq(VALUE fname)
{
- if (rb_respond_to(rb_cISeq, rb_intern("load_iseq"))) {
- VALUE iseqv = rb_funcall(rb_cISeq, rb_intern("load_iseq"), 1, fname);
- if (CLASS_OF(iseqv) == rb_cISeq) {
- return iseqw_check(iseqv);
- }
+ VALUE iseqv = rb_check_funcall(rb_cISeq, rb_intern("load_iseq"), 1, &fname);
+
+ if (!SPECIAL_CONST_P(iseqv) && RBASIC_CLASS(iseqv) == rb_cISeq) {
+ return iseqw_check(iseqv);
}
return NULL;