diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-08-30 22:11:00 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-08-30 22:11:00 -0700 |
commit | 60a08d9a6c11fda25bb73ded9e26aabc57af9433 (patch) | |
tree | c4fafffd8281cb5edb807a0e8e6af86dba7a0537 | |
parent | ec6206a81a1d61efe5bda69ab704c09e75033c01 (diff) |
Add rb_iseq_location
This wraps iseq_location and should fix the leaked global test.
-rw-r--r-- | proc.c | 8 | ||||
-rw-r--r-- | vm_args.c | 8 |
2 files changed, 11 insertions, 5 deletions
@@ -1183,7 +1183,7 @@ rb_proc_get_iseq(VALUE self, int *is_proc) return NULL; } -MJIT_FUNC_EXPORTED VALUE +static VALUE iseq_location(const rb_iseq_t *iseq) { VALUE loc[2]; @@ -1196,6 +1196,12 @@ iseq_location(const rb_iseq_t *iseq) return rb_ary_new4(2, loc); } +MJIT_FUNC_EXPORTED VALUE +rb_iseq_location(const rb_iseq_t *iseq) +{ + return iseq_location(iseq); +} + /* * call-seq: * prc.source_location -> [String, Integer] @@ -579,13 +579,13 @@ ignore_keyword_hash_p(VALUE keyword_hash, const rb_iseq_t * const iseq) { return 0; } -VALUE iseq_location(const rb_iseq_t *iseq); +VALUE rb_iseq_location(const rb_iseq_t *iseq); static inline void rb_warn_keyword_to_last_hash(struct rb_calling_info *calling, const struct rb_call_info *ci, const rb_iseq_t * const iseq) { if (calling->recv == Qundef) return; - VALUE loc = iseq_location(iseq); + VALUE loc = rb_iseq_location(iseq); if (NIL_P(loc)) { rb_warn("The keyword argument for `%s' is passed as the last hash parameter", rb_id2name(ci->mid)); } @@ -599,7 +599,7 @@ static inline void rb_warn_split_last_hash_to_keyword(struct rb_calling_info *calling, const struct rb_call_info *ci, const rb_iseq_t * const iseq) { if (calling->recv == Qundef) return; - VALUE loc = iseq_location(iseq); + VALUE loc = rb_iseq_location(iseq); if (NIL_P(loc)) { rb_warn("The last argument for `%s' is split into positional and keyword parameters", rb_id2name(ci->mid)); } @@ -613,7 +613,7 @@ static inline void rb_warn_last_hash_to_keyword(struct rb_calling_info *calling, const struct rb_call_info *ci, const rb_iseq_t * const iseq) { if (calling->recv == Qundef) return; - VALUE loc = iseq_location(iseq); + VALUE loc = rb_iseq_location(iseq); if (NIL_P(loc)) { rb_warn("The last argument for `%s' is used as the keyword parameter", rb_id2name(ci->mid)); } |