diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-03-27 11:45:01 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-03-27 13:26:22 +0900 |
| commit | 0c114dfcc79cb4690705ec88ebf9147e5c03702d (patch) | |
| tree | e80cb28bb5ded5d21f87cfc1a63cd886c8522cb3 | |
| parent | e51435177e88fc845528dff7cf2bc2b75dd36144 (diff) | |
Check existing ISeq wrapper
| -rw-r--r-- | iseq.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 { |
