From c2bfb4e93c674347b7eb09a30856e3d75f74cf4d Mon Sep 17 00:00:00 2001 From: shyouhei Date: Tue, 11 Sep 2018 09:48:58 +0000 Subject: add new instruction attribute called leaf An instruction is leaf if it has no rb_funcall inside. In order to check this property, we introduce stack canary which is a random number collected at runtime. Stack top is always filled with this number and checked for stack smashing operations, when VM_CHECK_MODE. [GH-1947] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- variable.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'variable.c') diff --git a/variable.c b/variable.c index 32e71fccb4..1c23173d6c 100644 --- a/variable.c +++ b/variable.c @@ -867,6 +867,24 @@ rb_gvar_defined(struct rb_global_entry *entry) return Qtrue; } +rb_gvar_getter_t * +rb_gvar_getter_function_of(const struct rb_global_entry *entry) +{ + return entry->var->getter; +} + +rb_gvar_setter_t * +rb_gvar_setter_function_of(const struct rb_global_entry *entry) +{ + return entry->var->setter; +} + +bool +rb_gvar_is_traced(const struct rb_global_entry *entry) +{ + return !!entry->var->trace; +} + static enum rb_id_table_iterator_result gvar_i(ID key, VALUE val, void *a) { -- cgit v1.2.3