aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* * iseq.c, vm_eval.c: set th->base_block properly.ko12012-06-229-37/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | th->base_block is information for (a) parsing, (b) compiling and (c) setting up the frame to execute the program passed by `eval' method. For example, (1) parser need to know up-level variables to detect it is variable or method without paren. Befor (a), (b) and (c), VM set th->base_block by passed bindng (or previous frame information). After execute (a), (b) and (c), VM should clear th->base_block. However, if (a), (b) or (c) raises an exception, then th->base_block is not cleared. Problem is that the uncleared value th->balo_block is used for irrelevant iseq compilation. It causes SEGV or critical error. I tried to solve this problem: to clear them before exception, but finally I found out that it is difficult to do it (Ruby program can be run in many places). Because of this background, I set th->base_block before compiling iseq and restore it after compiling. Basically, th->base_block is dirty hack (similar to global variable) and this patch is also dirty. * bootstraptest/test_eval.rb: add a test for above. * internal.h: remove unused decl. * iseq.c (rb_iseq_compile_with_option): add base_block parameter. set th->base_block before compation and restore it after compilation. * ruby.c (require_libraries): pass 0 as base_block instead of setting th->base_block * tool/compile_prelude.rb (prelude_eval): apply above changes. * vm.c, vm_eval.c: ditto. * vm_core.h: add comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c: pass struct rb_execarg value instead of its optionsakr2012-06-222-27/+47
| | | | | | | | | | | | | | | | | field for saving process attribute changing functions. (save_redirect_fd): take a struct rb_execarg argument. (run_exec_dup2): ditto. (run_exec_close): ditto. (run_exec_open): ditto. (run_exec_dup2_child): ditto. (run_exec_pgroup): ditto. (run_exec_rlimit): ditto. (save_env): ditto. (rb_execarg_run_options): follow the above functions change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_backtrace.rb: decrease recursion depthko12012-06-222-1/+6
| | | | | | | | to reduce consuming stack size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* marshal.c: io_needednobu2012-06-221-5/+11
| | | | | | * marshal.c (io_needed): extract from marshal_dump and marshal_load. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* random.c: check initialize and loadnobu2012-06-223-0/+29
| | | | | | | * random.c (random_init, random_load): cannot initialize frozen object again, nor with tainted/untrusted object. [Bug #6540] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: rb_check_copyablenobu2012-06-223-0/+21
| | | | | | | * error.c (rb_check_copyable): new function, to ensure the target is not frozen and the source is not tainted nor untrusted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: constant expressionnobu2012-06-221-4/+2
| | | | | | | * process.c (rb_exec_async_signal_safe): use a constant expression instead of a macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: fix indentnobu2012-06-221-4/+4
| | | | | | * variable.c (rb_ivar_count, rb_autoloading_value): fix indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2012-06-22svn2012-06-211-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_cleanup): Fixed typo. Patch by Trever Dawe.drbrain2012-06-212-1/+6
| | | | | | | Fixes #131 (github). [ruby-trunk - Bug #6619] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* needless RB_GC_GUARD removed.akr2012-06-211-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove garbage line.akr2012-06-211-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_execarg_addopt): take a VALUE argument instead ofakr2012-06-214-16/+26
| | | | | | | | | | | | | | struct rb_execarg. (rb_exec_arg_addopt): follow the rb_execarg_addopt change. (check_exec_options_i): ditto. * io.c (pipe_open): follow the rb_execarg_addopt change. * internal.h (rb_execarg_addopt): follow the definition change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_exec_fillarg): take a VALUE argument instead ofakr2012-06-212-5/+17
| | | | | | | | | | struct rb_execarg. (rb_check_exec_options): ditto. (check_exec_options_i): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_exec_async_signal_safe): use rb_execarg_run_optionsakr2012-06-212-3/+9
| | | | | | | | | instead of rb_run_exec_options_err. (rb_spawn_process): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_exec_fillarg): take a VALUE argument instead ofakr2012-06-212-2/+10
| | | | | | | | | struct rb_execarg. (rb_execarg_init): follow the rb_exec_fillarg change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove unused variables.akr2012-06-211-4/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_execarg_init): take a VALUE argument instead ofakr2012-06-213-6/+18
| | | | | | | | | | | | struct rb_execarg. (rb_execarg_new): follow the rb_execarg_init change. (rb_exec_arg_init): ditto. * internal.h (rb_execarg_init): follow the definition change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix GC problem of keyword rest argumentnobu2012-06-213-1/+16
| | | | | | | | | | * parse.y (new_args_tail_gen): fix GC problem of keyword rest argument. the wrapped struct should be bound to the wrapping node before assignment of child nodes, to get rid of the case the children are referred by only the struct pointer which is not a subject of GC. [ruby-core:45744] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: fix typenobu2012-06-211-1/+1
| | | | | | * process.c (rb_spawn_internal): fix type of a local variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (err_append): rename err_append() to compile_err_append()ko12012-06-202-34/+44
| | | | | | | | and move definition body. err_append() is used only by compiling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_execarg_fixup): take a VALUE argument instead ofakr2012-06-205-24/+33
| | | | | | | | | | | | | | struct rb_execarg. * internal.h (rb_execarg_fixup): follow the definition change. * io.c (pipe_open): follow rb_execarg_fixup change. * ext/pty/pty.c (establishShell): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2012-06-21svn2012-06-201-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typokazu2012-06-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (struct rb_execarg): add umask_given and umask_maskakr2012-06-203-11/+20
| | | | | | | | | | | | fields. * process.c (STATIC_ASSERT): removed. (rb_execarg_addopt): follow the rb_execarg change. (rb_execarg_run_options): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (struct rb_execarg) moved and renamed fromakr2012-06-206-62/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | struct rb_exec_arg in intern.h. * include/ruby/intern.h (struct rb_exec_arg): refer Data object which contains struct rb_execarg. * process.c: use struct rb_execarg instead of struct rb_exec_arg except functions declared in intern.h. (rb_exec_arg_addopt): extract a pointer to struct rb_execarg from struct rb_exec_arg. (rb_exec_arg_init): ditto. (rb_exec_arg_fixup): ditto. (rb_run_exec_options_err): ditto. (rb_run_exec_options): ditto. (rb_exec_err): ditto. (rb_exec): ditto. * io.c: use struct rb_execarg instead of struct rb_exec_arg. * ext/pty/pty.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_execarg_new): declared.akr2012-06-205-22/+129
| | | | | | | | | | | | | | | | | | | | | | | (rb_execarg_get): ditto. * process.c (mark_exec_arg): new function. (free_exec_arg): ditto. (memsize_exec_arg): ditto. (exec_arg_data_type): defined. (rb_execarg_new): new function. (rb_execarg_get): ditto. (rb_f_exec): use rb_execarg_new. (rb_spawn_internal): ditto. (rb_f_spawn): ditto. * io.c (pipe_open_v): use rb_execarg_new. (pipe_open_s): ditto. * ext/pty/pty.c (establishShell): use rb_execarg_new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* setproctitle.c: _NSGetEnvironnobu2012-06-202-0/+12
| | | | | | | | * missing/setproctitle.c (environ): use (*_NSGetEnviron()) instead of environ on Darwin for namespace cleanness, same as [ruby-core:00537]. [ruby-core:45615] [Bug #6576] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: optimizenobu2012-06-201-0/+20
| | | | | | * numeric.c (positive_int_p, negative_int_p): optimize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (positive_int_p, negative_int_p): extracted.nobu2012-06-201-16/+30
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: fixnum umasknobu2012-06-202-1/+6
| | | | | | | | * process.c (rb_execarg_addopt): always make Fixnum, and ignore higher bits in too large umask value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/test/unit.rb: workers sudden-deathnobu2012-06-202-1/+6
| | | | | | | * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): deal with sudden-death of workers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (init_leap_second_info): fix non-ANSI function declaration.kosaki2012-06-192-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (rb_f_sub): use ansi style declaration.kosaki2012-06-192-9/+9
| | | | | | | * ruby.c (rb_f_gsub): ditto. * ruby.c (rb_f_chomp): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * random.c (rb_random_int32): get rid of "warning: constant 0x100000000kosaki2012-06-192-1/+6
| | | | | | is so big it is long" warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_initialize): get rid of "unused return: argc = rb_scan_args()"kosaki2012-06-192-1/+6
| | | | | | warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/missing.h: include math.h before checking INFINITYkosaki2012-06-192-0/+6
| | | | | | and NAN. Otherwise, strange macro redefinition will occur. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2012-06-20svn2012-06-191-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_reverse): use ansi style declaration.kosaki2012-06-192-2/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: Fix typo in rdocmarcandre2012-06-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [Bug #6607]nobu2012-06-192-0/+12
| | | | | | * include/ruby/backward/rubysig.h: fix visibility. [Bug #6607] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/test/unit/parallel.rb: new method to report to the parentnobu2012-06-191-10/+15
| | | | | | | * lib/test/unit/parallel.rb (Test::Unit::Worker#_report): extract method to report to the parent process git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/readline/extconf.rb: no global namesnobu2012-06-191-54/+54
| | | | | | | * ext/readline/extconf.rb (readline): get rid of polluting global namespace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix async-signal-safe comments.akr2012-06-191-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: no method calls in async-signal-safenobu2012-06-192-1/+10
| | | | | | | | | * process.c (rb_execarg_run_options): do not call any methods in the async-signal-safe function. mask has been checked with NUM2MODET() already and converted with LONG2NUM(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Skip on non UTF-8 locale.naruse2012-06-191-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add test for [Bug #6262]naruse2012-06-191-0/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Skip Readline 4.3. [Feature #5785]naruse2012-06-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/readline/readline.c (Init_readline): don't set 0 tonaruse2012-06-192-6/+5
| | | | | | rl_catch_signals and rl_catch_sigwinch. [Bug #5423] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2012-06-19svn2012-06-191-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e