diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-19 04:49:27 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-19 04:49:27 +0000 |
commit | d1ca5e6d6a03b87ab58b496a2691fa55eaf36ea0 (patch) | |
tree | 8ea8848a00d6749194ab5565e87a1f0546900697 | |
parent | 1a7929a9696b98f355415edc1d62cd2f9425fcac (diff) | |
download | ruby-d1ca5e6d6a03b87ab58b496a2691fa55eaf36ea0.tar.gz |
* eval.c (rb_eval_string_wrap): should hide the toplevel local
variable bindings by PUSH_SCOPE().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | eval.c | 2 | ||||
-rw-r--r-- | regex.c | 10 | ||||
-rw-r--r-- | sample/rename.rb | 297 |
4 files changed, 7 insertions, 307 deletions
@@ -1,3 +1,8 @@ +Tue Feb 19 13:38:10 2002 Yukihiro Matsumoto <matz@ruby-lang.org> + + * eval.c (rb_eval_string_wrap): should hide the toplevel local + variable bindings by PUSH_SCOPE(). + Tue Feb 19 13:21:51 2002 WATANABE Hirofumi <eban@ruby-lang.org> * regex.c: fix prototypes of xmalloc(), xcalloc() and xrealloc(). @@ -1297,10 +1297,12 @@ rb_eval_string_wrap(str, state) ruby_frame->last_class = 0; ruby_frame->self = self; ruby_frame->cbase = (VALUE)rb_node_newnode(NODE_CREF,ruby_wrapper,0,0); + PUSH_SCOPE(); val = rb_eval_string_protect(str, &status); ruby_top_self = self; + POP_SCOPE(); POP_FRAME(); POP_CLASS(); ruby_wrapper = wrapper; @@ -72,16 +72,6 @@ void rb_trap_exec _((void)); # define CHECK_INTS if (!rb_prohibit_interrupt) {\ if (rb_trap_pending) rb_trap_exec();\ } - -#define xmalloc ruby_xmalloc -#define xcalloc ruby_xcalloc -#define xrealloc ruby_xrealloc -#define xfree ruby_xfree - -void *xmalloc _((long)); -void *xcalloc _((long,long)); -void *xrealloc _((void*,long)); -void xfree _((void*)); #endif /* Make alloca work the best possible way. */ diff --git a/sample/rename.rb b/sample/rename.rb deleted file mode 100644 index 2d1b62ea8f..0000000000 --- a/sample/rename.rb +++ /dev/null @@ -1,297 +0,0 @@ -#! /usr/local/bin/ruby -p -gsub!(/\bary_aref\b/,"rb_ary_aref") -gsub!(/\bary_assoc\b/,"rb_ary_assoc") -gsub!(/\bary_concat\b/,"rb_ary_concat") -gsub!(/\bary_delete\b/,"rb_ary_delete") -gsub!(/\bary_delete_at\b/,"rb_ary_delete_at") -gsub!(/\bary_each\b/,"rb_ary_each") -gsub!(/\bary_entry\b/,"rb_ary_entry") -gsub!(/\bary_freeze\b/,"rb_ary_freeze") -gsub!(/\bary_includes\b/,"rb_ary_includes") -gsub!(/\bary_join\b/,"rb_ary_join") -gsub!(/\bary_new([234])?\b/,"rb_ary_new\\1") -gsub!(/\bary_plus\b/,"rb_ary_plus") -gsub!(/\bary_pop\b/,"rb_ary_pop") -gsub!(/\bary_push\b/,"rb_ary_push") -gsub!(/\bary_rassoc\b/,"rb_ary_rassoc") -gsub!(/\bary_reverse\b/,"rb_ary_reverse") -gsub!(/\bary_shift\b/,"rb_ary_shift") -gsub!(/\bary_sort\b/,"rb_ary_sort") -gsub!(/\bary_store\b/,"rb_ary_store") -gsub!(/\bary_to_s\b/,"rb_ary_to_s") -gsub!(/\bary_unshift\b/,"rb_ary_unshift") -gsub!(/\bassoc_new\b/,"rb_assoc_new") -gsub!(/\bcArray\b/,"rb_cArray") -gsub!(/\bmemclear\b/,"rb_mem_clear") -gsub!(/\bbig2dbl\b/,"rb_big2dbl") -gsub!(/\bbig2long\b/,"rb_big2long") -gsub!(/\bbig2str\b/,"rb_big2str") -gsub!(/\bbig2ulong\b/,"rb_big2ulong") -gsub!(/\bbig_2comp\b/,"rb_big_2comp") -gsub!(/\bbig_and\b/,"rb_big_and") -gsub!(/\bbig_clone\b/,"rb_big_clone") -gsub!(/\bbig_lshift\b/,"rb_big_lshift") -gsub!(/\bbig_minus\b/,"rb_big_minus") -gsub!(/\bbig_mul\b/,"rb_big_mul") -gsub!(/\bbig_norm\b/,"rb_big_norm") -gsub!(/\bbig_or\b/,"rb_big_or") -gsub!(/\bbig_plus\b/,"rb_big_plus") -gsub!(/\bbig_pow\b/,"rb_big_pow") -gsub!(/\bbig_rand\b/,"rb_big_rand") -gsub!(/\bbig_xor\b/,"rb_big_xor") -gsub!(/\bcBignum\b/,"rb_cBignum") -gsub!(/\bdbl2big\b/,"rb_dbl2big") -gsub!(/\bint2big\b/,"rb_int2big") -gsub!(/\bint2inum\b/,"rb_int2inum") -gsub!(/\bstr2inum\b/,"rb_str2inum") -gsub!(/\buint2big\b/,"rb_uint2big") -gsub!(/\buint2inum\b/,"rb_uint2inum") -gsub!(/\bclass_instance_methods\b/,"rb_class_instance_methods") -gsub!(/\bclass_new\b/,"rb_class_new") -gsub!(/\bclass_private_instance_methods\b/,"rb_class_private_instance_methods") -gsub!(/\bclass_protected_instance_methods\b/,"rb_class_protected_instance_methods") -gsub!(/\bmod_ancestors\b/,"rb_mod_ancestors") -gsub!(/\bmod_included_modules\b/,"rb_mod_included_modules") -gsub!(/\bmodule_new\b/,"rb_module_new") -gsub!(/\bobj_singleton_methods\b/,"rb_obj_singleton_methods") -gsub!(/\bsingleton_class\b/,"rb_singleton_class") -gsub!(/\bmComparable\b/,"rb_mComparable") -gsub!(/\bcDir\b/,"rb_cDir") -gsub!(/\benum_length\b/,"rb_enum_length") -gsub!(/\bmEnumerable\b/,"rb_mEnumerable") -gsub!(/\bBug\b/,"rb_bug") -gsub!(/\brb_check_type\b/,"rb_check_type") -gsub!(/\beArgError\b/,"rb_eArgError") -gsub!(/\beException\b/,"rb_eException") -gsub!(/\beFatal\b/,"rb_eFatal") -gsub!(/\beIndexError\b/,"rb_eIndexError") -gsub!(/\beInterrupt\b/,"rb_eInterrupt") -gsub!(/\beLoadError\b/,"rb_eLoadError") -gsub!(/\beNameError\b/,"rb_eNameError") -gsub!(/\beNotImpError\b/,"rb_eNotImpError") -gsub!(/\beRuntimeError\b/,"rb_eRuntimeError") -gsub!(/\beSecurityError\b/,"rb_eSecurityError") -gsub!(/\beStandardError\b/,"rb_eStandardError") -gsub!(/\beSyntaxError\b/,"rb_eSyntaxError") -gsub!(/\beSystemCallError\b/,"rb_eSystemCallError") -gsub!(/\beSystemExit\b/,"rb_eSystemExit") -gsub!(/\beTypeError\b/,"rb_eTypeError") -gsub!(/\bexc_new([23]?)\b/,"rb_exc_new\\1") -gsub!(/\bFatal\b/,"rb_fatal") -gsub!(/\bLoadError\b/,"rb_loaderror") -gsub!(/\bmErrno\b/,"rb_mErrno") -gsub!(/\bRaise\b/,"rb_raise") -gsub!(/\bWarn(ing)?\b/,"rb_warn\\1") -gsub!(/\bnerrs\b/,"ruby_nerrs") -gsub!(/\bcProc\b/,"rb_cProc") -gsub!(/\bcThread\b/,"rb_cThread") -gsub!(/\brb_check_safe_str\b/,"rb_check_safe_str") -gsub!(/\bclass_new_instance\b/,"rb_class_new_instance") -gsub!(/\bdyna_var_asgn\b/,"rb_dvar_asgn") -gsub!(/\bdyna_var_defined\b/,"rb_dvar_defined") -gsub!(/\bdyna_var_push\b/,"rb_dvar_push") -gsub!(/\bdyna_var_ref\b/,"rb_dvar_ref") -gsub!(/\bf_lambda\b/,"rb_f_lambda") -gsub!(/\bf_load\b/,";xxx_need_modify;rb_load") -gsub!(/\bf_require\b/,"rb_f_require") -gsub!(/\bgc_mark_threads\b/,"rb_gc_mark_threads") -gsub!(/\biterator_p\b/,"rb_iterator_p") -gsub!(/\bobj_call_init\b/,"rb_obj_call_init") -gsub!(/\brb_set_end_proc\b/,"rb_set_end_proc") -gsub!(/\brb_set_safe_level\b/,"rb_set_safe_level") -gsub!(/\bthread_alone\b/,"rb_thread_alone") -gsub!(/\bthread_create\b/,"rb_thread_create") -gsub!(/\bthread_critical\b/,"rb_thread_critical") -gsub!(/\bthread_fd_writable\b/,"rb_thread_fd_writable") -gsub!(/\bthread_interrupt\b/,"rb_thread_interrupt") -gsub!(/\bthread_schedule\b/,"rb_thread_schedule") -gsub!(/\bthread_select\b/,"rb_thread_select") -gsub!(/\bthread_sleep\b/,"rb_thread_sleep") -gsub!(/\bthread_sleep_forever\b/,"rb_thread_sleep_forever") -gsub!(/\bthread_trap_eval\b/,"rb_thread_trap_eval") -gsub!(/\bthread_wait_fd\b/,"rb_thread_wait_fd") -gsub!(/\bthread_wait_for\b/,"rb_thread_wait_for") -gsub!(/\bthe_class\b/,"ruby_class") -gsub!(/\bthe_dyna_vars\b/,"ruby_dyna_vars") -gsub!(/\bthe_frame\b/,"ruby_frame") -gsub!(/\bthe_init\b/,"ruby_init") -gsub!(/\bthe_scope\b/,"ruby_scope") -gsub!(/\bcFile\b/,"rb_cFile") -gsub!(/\bfile_open\b/,"rb_file_open") -gsub!(/\bfile_s_expand_path\b/,"rb_file_s_expand_path") -gsub!(/\bmFileTest\b/,"rb_mFileTest") -gsub!(/\bdata_object_alloc\b/,"rb_data_object_alloc") -gsub!(/\bgc_call_finalizer_at_exit\b/,"rb_gc_call_finalizer_at_exit") -gsub!(/\bgc_force_recycle\b/,"rb_gc_force_recycle") -gsub!(/\bgc_gc\b/,"rb_gc") -gsub!(/\bgc_mark\b/,"rb_gc_mark") -gsub!(/\bgc_stack_start\b/,"rb_gc_stack_start") -gsub!(/\bmGC\b/,"rb_mGC") -gsub!(/\bcHash\b/,"rb_cHash") -gsub!(/\benv_path_tainted\b/,"rb_env_path_tainted") -gsub!(/\bhash_aref\b/,"rb_hash_aref") -gsub!(/\bhash_aset\b/,"rb_hash_aset") -gsub!(/\bhash_freeze\b/,"rb_hash_freeze") -gsub!(/\bhash_new\b/,"rb_hash_new") -gsub!(/\bcIO\b/,"rb_cIO") -gsub!(/\beEOFError\b/,"rb_eEOFError") -gsub!(/\beIOError\b/,"rb_eIOError") -gsub!(/\beof_error\b/,"rb_eof_error") -gsub!(/\bf_gets\b/,"rb_f_gets") -gsub!(/\bio_binmode\b/,"rb_io_binmode") -gsub!(/\bio_check_closed\b/,"rb_io_check_closed") -gsub!(/\bio_readable\b/,"rb_io_check_readable") -gsub!(/\bio_writable\b/,"rb_io_check_writable") -gsub!(/\bio_close\b/,"rb_io_close") -gsub!(/\bio_fptr_finalize\b/,"rb_io_fptr_finalize") -gsub!(/\bio_getc\b/,"rb_io_getc") -gsub!(/\bio_gets\b/,"rb_io_gets") -gsub!(/\bio_gets_method\b/,"rb_io_gets_method") -gsub!(/\bio_mode_flags\b/,"rb_io_mode_flags") -gsub!(/\bio_reopen\b/,"rb_io_reopen") -gsub!(/\bio_unbuffered\b/,"rb_io_unbuffered") -gsub!(/\bio_ungetc\b/,"rb_io_ungetc") -gsub!(/\bio_write\b/,"rb_io_write") -gsub!(/\bRS_default\b/,"ruby_default_rs") -gsub!(/\bOFS\b/,"ruby_output_fs") -gsub!(/\bORS\b/,"ruby_output_rs") -gsub!(/\bFS\b/,"ruby_fs") -gsub!(/\bRS\b/,"ruby_rs") -gsub!(/\bmMath\b/,"rb_mMath") -gsub!(/\bcFixnum\b/,"rb_cFixnum") -gsub!(/\bcFloat\b/,"rb_cFloat") -gsub!(/\bcInteger\b/,"rb_cInteger") -gsub!(/\bcNumeric\b/,"rb_cNumeric") -gsub!(/\beZeroDiv\b/,"rb_eZeroDiv") -gsub!(/\bfix2int\b/,"rb_fix2int") -gsub!(/\bfix2str\b/,"rb_fix2str") -gsub!(/\bfix_upto\b/,"rb_fix_upto") -gsub!(/\bfloat_new\b/,"rb_float_new") -gsub!(/\bnum2fix\b/,"rb_num2fix") -gsub!(/\bnum2int\b/,"rb_num2int") -gsub!(/\bnum2long\b/,"rb_num2long") -gsub!(/\bnum2ulong\b/,"rb_num2ulong") -gsub!(/\bnum_coerce_bin\b/,"rb_num_coerce_bin") -gsub!(/\bnum_zerodiv\b/,"rb_num_zerodiv") -gsub!(/\bany_to_s\b/,"rb_any_to_s") -gsub!(/\bcClass\b/,"rb_cClass") -gsub!(/\bcData\b/,"rb_cData") -gsub!(/\bcFalseClass\b/,"rb_cFalseClass") -gsub!(/\bcModule\b/,"rb_cModule") -gsub!(/\bcNilClass\b/,"rb_cNilClass") -gsub!(/\bcObject\b/,"rb_cObject") -gsub!(/\bcTrueClass\b/,"rb_cTrueClass") -gsub!(/\bmKernel\b/,"rb_mKernel") -gsub!(/\bnum2dbl\b/,"rb_num2dbl") -gsub!(/\bobj_alloc\b/,"rb_obj_alloc") -gsub!(/\bobj_equal\b/,"rb_obj_equal") -gsub!(/\bobj_is_instance_of\b/,"rb_obj_is_instance_of") -gsub!(/\bobj_is_kind_of\b/,"rb_obj_is_kind_of") -gsub!(/\bstr2cstr\b/,"rb_str2cstr") -gsub!(/\bTopSelf\b/,"rb_top_self") -gsub!(/\bbackref_get\b/,"rb_backref_get") -gsub!(/\bbackref_set\b/,"rb_backref_set") -gsub!(/\bcompile_file\b/,"rb_compile_file") -gsub!(/\bcompile_string\b/,"rb_compile_string") -gsub!(/\bid_attrset\b/,"rb_id_attrset") -gsub!(/\bis_const_id\b/,"rb_is_const_id") -gsub!(/\bis_instance_id\b/,"rb_is_instance_id") -gsub!(/\blastline_get\b/,"rb_lastline_get") -gsub!(/\blastline_set\b/,"rb_lastline_set") -gsub!(/\bnode_newnode\b/,"rb_node_newnode") -gsub!(/\byyappend_print\b/,"rb_parser_append_print") -gsub!(/\byywhile_loop\b/,"rb_parser_while_loop") -gsub!(/\brb_reserved_word\b/,"rb_reserved_word") -gsub!(/\bsourcefile\b/,"ruby_sourcefile") -gsub!(/\bsourceline\b/,"ruby_sourceline") -gsub!(/\bmProcess\b/,"rb_mProcess") -gsub!(/\bcRange\b/,"rb_cRange") -gsub!(/\brange_beg_end\b/,"rb_range_beg_end") -gsub!(/\brange_new\b/,"rb_range_new") -gsub!(/\bcRegexp\b/,"rb_cRegexp") -gsub!(/\bignorecase\b/,"rb_ignorecase") -gsub!(/\breg_free\b/,"rb_reg_free") -gsub!(/\breg_last_match\b/,"rb_reg_last_match") -gsub!(/\breg_match\b/,"rb_reg_match") -gsub!(/\breg_new\b/,"rb_reg_new") -gsub!(/\breg_nth_defined\b/,"rb_reg_nth_defined") -gsub!(/\breg_nth_match\b/,"rb_reg_nth_match") -gsub!(/\breg_options\b/,"rb_reg_options") -gsub!(/\breg_prepare_re\b/,"rb_reg_prepare_re") -gsub!(/\breg_regcomp\b/,"rb_reg_regcomp") -gsub!(/\breg_regsub\b/,"rb_reg_regsub") -gsub!(/\breg_search\b/,"rb_reg_search") -gsub!(/\bstr_cicmp\b/,"rb_str_cicmp") -gsub!(/\bf_kill\b/,"rb_f_kill") -gsub!(/\bgc_mark_trap_list\b/,"rb_gc_mark_trap_list") -gsub!(/\bprohibit_interrupt\b/,"rb_prohibit_interrupt") -gsub!(/\btrap_exec\b/,"rb_trap_exec") -gsub!(/\btrap_exit\b/,"rb_trap_exit") -gsub!(/\btrap_immediate\b/,"rb_trap_immediate") -gsub!(/\btrap_pending\b/,"rb_trap_pending") -gsub!(/\btrap_restore_mask\b/,"rb_trap_restore_mask") -gsub!(/\bposix_signal\b/,"ruby_posix_signal") -gsub!(/\bf_sprintf\b/,"rb_f_sprintf") -gsub!(/\bcString\b/,"rb_cString") -gsub!(/\bobj_as_string\b/,"rb_obj_as_string") -gsub!(/\bstr_cat\b/,"rb_str_cat") -gsub!(/\bstr_cmp\b/,"rb_str_cmp") -gsub!(/\bstr_concat\b/,"rb_str_concat") -gsub!(/\bstr_dup\b/,"rb_str_dup") -gsub!(/\bstr_dup_frozen\b/,"rb_str_dup_frozen") -gsub!(/\bstr_freeze\b/,"rb_str_freeze") -gsub!(/\bstr_hash\b/,"rb_str_hash") -gsub!(/\bstr_inspect\b/,"rb_str_inspect") -gsub!(/\bstr_modify\b/,"rb_str_modify") -gsub!(/\bstr_new([234]?)\b/,"rb_str_new\\1") -gsub!(/\bstr_plus\b/,"rb_str_plus") -gsub!(/\bstr_resize\b/,"rb_str_resize") -gsub!(/\bstr_split\b/,"rb_str_split") -gsub!(/\bstr_substr\b/,"rb_str_substr") -gsub!(/\bstr_taint\b/,"rb_obj_taint") -gsub!(/\bstr_tainted\b/,"rb_obj_tainted") -gsub!(/\bstr_times\b/,"rb_str_times") -gsub!(/\bstr_to_str\b/,"rb_str_to_str") -gsub!(/\bstr_upto\b/,"rb_str_upto") -gsub!(/\bcStruct\b/,"rb_cStruct") -gsub!(/\bstruct_alloc\b/,"rb_struct_alloc") -gsub!(/\bstruct_aref\b/,"rb_struct_aref") -gsub!(/\bstruct_aset\b/,"rb_struct_aset") -gsub!(/\bstruct_define\b/,"rb_struct_define") -gsub!(/\bstruct_getmember\b/,"rb_struct_getmember") -gsub!(/\bstruct_new\b/,"rb_struct_new") -gsub!(/\bcTime\b/,"rb_cTime") -gsub!(/\btime_new\b/,"rb_time_new") -gsub!(/\btime_timeval\b/,"rb_time_timeval") -gsub!(/\bscan_hex\b/,"ruby_scan_hex") -gsub!(/\bscan_oct\b/,"ruby_scan_oct") -gsub!(/\bconst_defined\b/,"rb_const_defined") -gsub!(/\bconst_defined_at\b/,"rb_const_defined_at") -gsub!(/\bconst_get\b/,"rb_const_get") -gsub!(/\bconst_get_at\b/,"rb_const_get") -gsub!(/\bconst_set\b/,"rb_const_set") -gsub!(/\bf_autoload\b/,"rb_f_autoload") -gsub!(/\bf_global_variables\b/,"rb_f_global_variables") -gsub!(/\bf_trace_var\b/,"rb_f_trace_var") -gsub!(/\bf_untrace_var\b/,"rb_f_untrace_var") -gsub!(/\bmod_const_at\b/,"rb_mod_const_at") -gsub!(/\bmod_const_of\b/,"rb_mod_const_of") -gsub!(/\bmod_constants\b/,"rb_mod_constants") -gsub!(/\bmod_name\b/,"rb_mod_name") -gsub!(/\bmod_remove_const\b/,"rb_mod_remove_const") -gsub!(/\bobj_instance_variables\b/,"rb_obj_instance_variables") -gsub!(/\bobj_remove_instance_variable\b/,"rb_obj_remove_instance_variable") -gsub!(/\bshow_copyright\b/,"ruby_show_copyright") -gsub!(/\bshow_version\b/,"ruby_show_version") -gsub!(/\bdebug\b/,"ruby_debug") -gsub!(/\bverbose\b/,"ruby_verbose") -gsub!(/\bFail\(/,"rb_raise(rb_eRuntimeError, ") -gsub!(/\bArgError\(/,"rb_raise(rb_eArgError, ") -gsub!(/\bTypeError\(/,"rb_raise(rb_eTypeError, ") -gsub!(/\bNameError\(/,"rb_raise(rb_eNameError, ") -gsub!(/\bIndexError\(/,"rb_raise(rb_eIndexError, ") -gsub!(/\bError\b/,"rb_compile_error") -gsub!(/\bErrorAppend\b/,"rb_compile_error_append") -gsub!(/\bTRUE\b/,"Qtrue") -gsub!(/\bFALSE\b/,"Qfalse") -gsub!(/\berrinfo\b/,"ruby_errinfo") |