1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add debug assertion in rb_funcall* that the current thread has the gvl.

This commit is contained in:
Samuel Williams 2021-07-16 15:43:57 +12:00
parent 55a79b648c
commit 6073a8bdc0
Notes: git 2021-07-16 14:32:24 +09:00
3 changed files with 6 additions and 0 deletions

View file

@ -15206,6 +15206,7 @@ vm.$(OBJEXT): $(top_srcdir)/internal/serial.h
vm.$(OBJEXT): $(top_srcdir)/internal/static_assert.h vm.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
vm.$(OBJEXT): $(top_srcdir)/internal/string.h vm.$(OBJEXT): $(top_srcdir)/internal/string.h
vm.$(OBJEXT): $(top_srcdir)/internal/symbol.h vm.$(OBJEXT): $(top_srcdir)/internal/symbol.h
vm.$(OBJEXT): $(top_srcdir)/internal/thread.h
vm.$(OBJEXT): $(top_srcdir)/internal/variable.h vm.$(OBJEXT): $(top_srcdir)/internal/variable.h
vm.$(OBJEXT): $(top_srcdir)/internal/vm.h vm.$(OBJEXT): $(top_srcdir)/internal/vm.h
vm.$(OBJEXT): $(top_srcdir)/internal/warnings.h vm.$(OBJEXT): $(top_srcdir)/internal/warnings.h

1
vm.c
View file

@ -23,6 +23,7 @@
#include "internal/proc.h" #include "internal/proc.h"
#include "internal/re.h" #include "internal/re.h"
#include "internal/symbol.h" #include "internal/symbol.h"
#include "internal/thread.h"
#include "internal/vm.h" #include "internal/vm.h"
#include "internal/sanitizers.h" #include "internal/sanitizers.h"
#include "iseq.h" #include "iseq.h"

View file

@ -1036,12 +1036,16 @@ rb_funcallv_scope(VALUE recv, ID mid, int argc, const VALUE *argv, call_type sco
VALUE VALUE
rb_funcallv(VALUE recv, ID mid, int argc, const VALUE *argv) rb_funcallv(VALUE recv, ID mid, int argc, const VALUE *argv)
{ {
VM_ASSERT(ruby_thread_has_gvl_p());
return rb_funcallv_scope(recv, mid, argc, argv, CALL_FCALL); return rb_funcallv_scope(recv, mid, argc, argv, CALL_FCALL);
} }
VALUE VALUE
rb_funcallv_kw(VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat) rb_funcallv_kw(VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat)
{ {
VM_ASSERT(ruby_thread_has_gvl_p());
return rb_call(recv, mid, argc, argv, kw_splat ? CALL_FCALL_KW : CALL_FCALL); return rb_call(recv, mid, argc, argv, kw_splat ? CALL_FCALL_KW : CALL_FCALL);
} }