summaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2022-12-26 17:45:44 +0900
committerYuichiro Kaneko <spiketeika@gmail.com>2023-01-06 09:22:09 +0900
commit979dd02e2f0a70f3f30d47c6115780d8fac6147e (patch)
tree926a7eb7ee9c0739b20804e19465979c61b94912 /ast.c
parent2056c0a7c680350cf92a134e355c03e1efb10549 (diff)
downloadruby-979dd02e2f0a70f3f30d47c6115780d8fac6147e.tar.gz
Check if the argument is Thread::Backtrace::Location object
[Bug #19262]
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ast.c b/ast.c
index bf3781d820..adb7287ed3 100644
--- a/ast.c
+++ b/ast.c
@@ -202,6 +202,11 @@ static VALUE
node_id_for_backtrace_location(rb_execution_context_t *ec, VALUE module, VALUE location)
{
int node_id;
+
+ if (!rb_frame_info_p(location)) {
+ rb_raise(rb_eTypeError, "Thread::Backtrace::Location object expected");
+ }
+
node_id = rb_get_node_id_from_frame_info(location);
if (node_id == -1) {
return Qnil;