summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-03-27 11:45:01 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2024-03-27 13:26:22 +0900
commit0c114dfcc79cb4690705ec88ebf9147e5c03702d (patch)
treee80cb28bb5ded5d21f87cfc1a63cd886c8522cb3
parente51435177e88fc845528dff7cf2bc2b75dd36144 (diff)
Check existing ISeq wrapper
-rw-r--r--iseq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index d00cc9e9cc..3e45c7b621 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1417,6 +1417,10 @@ static VALUE
iseqw_new(const rb_iseq_t *iseq)
{
if (iseq->wrapper) {
+ if (rb_check_typeddata(iseq->wrapper, &iseqw_data_type) != iseq) {
+ rb_raise(rb_eTypeError, "wrong iseq wrapper: %" PRIsVALUE " for %p",
+ iseq->wrapper, (void *)iseq);
+ }
return iseq->wrapper;
}
else {