summaryrefslogtreecommitdiff
path: root/namespace.c
diff options
context:
space:
mode:
authorSatoshi Tagomori <s-tagomori@sakura.ad.jp>2025-07-27 11:04:15 +0900
committerSatoshi Tagomori <tagomoris@gmail.com>2025-09-29 01:15:38 +0900
commit20c73b17232cc5bd0f8a3c13507d56b5f11ab2ed (patch)
tree9baff7b5a8c93fd7911926077d19029b86beb847 /namespace.c
parenta5df24fe010d3631b324a6aadcb2db5b32c270e5 (diff)
Skip CFUNC frames in the current namespace detection
* The current namespace should be based on the Ruby-level location (file, line no in .rb) and we can get it by LEP(ep) basically (VM_ENV_FLAG_LOCAL flag is set) * But the control frame with VM_FRAME_MAGIC_CFUNC is also a LOCAL frame because it's a visible Ruby-level frame without block handlers * So, for the namespace detection, LEP(ep) is not enough and we need to skip CFUNC frames to fetch the caller of such frames
Diffstat (limited to 'namespace.c')
-rw-r--r--namespace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/namespace.c b/namespace.c
index e30d426d68..82bacd4108 100644
--- a/namespace.c
+++ b/namespace.c
@@ -460,7 +460,7 @@ rb_namespace_s_current(VALUE recv)
if (!rb_namespace_available())
return Qnil;
- ns = rb_vm_caller_namespace(GET_EC());
+ ns = rb_vm_current_namespace(GET_EC());
VM_ASSERT(ns && ns->ns_object);
return ns->ns_object;
}