From 36df55c6e4dff444d92eb5c44d2ecb65567427e6 Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 25 Dec 2007 09:43:23 +0000 Subject: * iseq.c: all methods need $SAFE < 1. vm.c: comment out debug functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ iseq.c | 10 ++++++++++ vm.c | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e0eba52d8..1a80bb439c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Dec 25 18:40:46 2007 Koichi Sasada + + * iseq.c: all methods need $SAFE < 1. + + vm.c: comment out debug functions. + Tue Dec 25 18:27:51 2007 Tanaka Akira * string.c (rb_str_each_line): don't call rb_enc_codepoint with empty diff --git a/iseq.c b/iseq.c index 9cf3ba5bad..4ad664eced 100644 --- a/iseq.c +++ b/iseq.c @@ -455,6 +455,8 @@ iseq_s_compile(int argc, VALUE *argv, VALUE self) { VALUE src, file = Qnil, line = INT2FIX(1), opt = Qnil; + rb_secure(1); + rb_scan_args(argc, argv, "13", &src, &file, &line, &opt); file = file == Qnil ? rb_str_new2("") : file; line = line == Qnil ? INT2FIX(1) : line; @@ -472,6 +474,7 @@ iseq_s_compile_file(int argc, VALUE *argv, VALUE self) const char *fname; rb_compile_option_t option; + rb_secure(1); rb_scan_args(argc, argv, "11", &file, &opt); fname = StringValueCStr(file); @@ -488,6 +491,7 @@ static VALUE iseq_s_compile_option_set(VALUE self, VALUE opt) { rb_compile_option_t option; + rb_secure(1); make_compile_option(&option, opt); COMPILE_OPTION_DEFAULT = option; return opt; @@ -513,6 +517,7 @@ iseq_check(VALUE val) static VALUE iseq_eval(VALUE self) { + rb_secure(1); return rb_iseq_eval(self); } @@ -534,6 +539,7 @@ static VALUE iseq_to_a(VALUE self) { rb_iseq_t *iseq = iseq_check(self); + rb_secure(1); return iseq_data_to_ary(iseq); } @@ -792,6 +798,8 @@ ruby_iseq_disasm(VALUE self) char buff[0x200]; enum {header_minlen = 72}; + rb_secure(1); + iseq = iseqdat->iseq; size = iseqdat->iseq_size; @@ -891,6 +899,8 @@ iseq_s_disasm(VALUE klass, VALUE body) NODE *node; VALUE ret = Qnil; + rb_secure(1); + if ((node = rb_method_body(body)) != 0) { if (nd_type(node) == RUBY_VM_METHOD_NODE) { VALUE iseqval = (VALUE)node->nd_body; diff --git a/vm.c b/vm.c index 0da900dfc8..6eff96ad85 100644 --- a/vm.c +++ b/vm.c @@ -1811,8 +1811,8 @@ Init_VM(void) rb_define_const(rb_cVM, "INSTRUCTION_NAMES", insns_name_array()); /* debug functions ::VM::SDR(), ::VM::NSDR() */ - rb_define_singleton_method(rb_cVM, "SDR", sdr, 0); - rb_define_singleton_method(rb_cVM, "NSDR", nsdr, 0); + /* rb_define_singleton_method(rb_cVM, "SDR", sdr, 0); */ + /* rb_define_singleton_method(rb_cVM, "NSDR", nsdr, 0); */ /* VM bootstrap: phase 2 */ { -- cgit v1.2.3