From 2d48ffe69ebebf712fe934309fc014e8b37d8959 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 27 Mar 2024 11:33:17 -0400 Subject: [PATCH] Use rb_iseqw_to_iseq to get iseq pointer Using DATA_PTR is internal implementation details so we should not use it. --- ext/debug/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/debug/debug.c b/ext/debug/debug.c index 5404c92d2..b27263d46 100644 --- a/ext/debug/debug.c +++ b/ext/debug/debug.c @@ -8,13 +8,13 @@ static VALUE rb_mDebugger; // iseq typedef struct rb_iseq_struct rb_iseq_t; +const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw); VALUE rb_iseq_realpath(const rb_iseq_t *iseq); static VALUE iseq_realpath(VALUE iseqw) { - rb_iseq_t *iseq = DATA_PTR(iseqw); - return rb_iseq_realpath(iseq); + return rb_iseq_realpath(rb_iseqw_to_iseq(iseqw)); } static VALUE rb_cFrameInfo;