aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* * pack.c (pack_unpack): Add casts for char references for 'b' and 'h'.akr2014-10-172-2/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Avoid undefined behaviors found by gcc -fsanitize=undefined.akr2014-10-173-2/+13
| | | | | | | | | | gcc (Debian 4.9.1-16) 4.9.1 * string.c (rb_str_sum): Avoid undefined behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Avoid undefined behaviors found by gcc -fsanitize=undefined.akr2014-10-178-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | gcc (Debian 4.9.1-16) 4.9.1 * include/ruby/ruby.h (INT2FIX): Avoid undefined behavior. * node.h (nd_set_line): Ditto. * pack.c (encodes): Ditto. (pack_unpack): Ditto. * regint.h (BIT_STATUS_AT): Ditto. (BS_BIT): Ditto. * time.c (time_mdump): Ditto. (time_mload): Ditto. * vm_core.h (VM_FRAME_MAGIC_MASK): Ditto. * vm_trace.c (recalc_add_ruby_vm_event_flags): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c (register_sym): debug codenobu2014-10-171-0/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* erb: multiline anchorsnobu2014-10-171-3/+4
| | | | | | | * bin/erb (ARGV.switch, ERB::Main#run): use beginning/end of string anchors instead of beginning/end of line anchors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* erb: fix -U optionnobu2014-10-171-2/+2
| | | | | | * bin/erb (ERB::Main#run): fix NoMethodError at -U option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* re.c: mak eregexps with binary escapes ASCII-8BITnobu2014-10-173-2/+19
| | | | | | | | | * re.c (unescape_nonascii): make dynamically compiled US-ASCII regexps ASCII-8BIT encoding if binary (hexadecimal, control, meta) escapes are contained, as well as literal regexps. [ruby-dev:48626] [Bug #10382] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: use writevnobu2014-10-171-3/+23
| | | | | | | * signal.c (check_reserved_signal): print messages by writev() if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: exclude terminatorsnobu2014-10-171-2/+3
| | | | | | | * signal.c (check_reserved_signal): exclude terminator in literal strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2014-10-17svn2014-10-161-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r47971, r47972 [ruby-core:65764]normal2014-10-163-2/+9
| | | | | | | | | | | | | The current implementation currently delivers signals to self immediately and synchronously, so we do not need explicit, potentially-confusing sleeps to wait for signal delivery. * test/-ext-/bug_reporter/test_bug_reporter.rb (test_bug_reporter_add): revert r47972 * test/ruby/test_rubyoptions.rb (test_segv_test): revert r47971 [ruby-core:65764] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: get rid of heap corruptionnobu2014-10-162-1/+7
| | | | | | | | * signal.c (rb_sigaltstack_size): double default size to get rid of heap corruption by alternate stack overflow in SEGV handler. typically happened at fprintf() in control_frame_dump(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_backtrace.c (id2str): Fix a variable name.akr2014-10-162-1/+6
| | | | | | | | [ruby-dev:48642] [Bug #10389] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Set an encoding for SEGV message.akr2014-10-161-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Set ASCII-8BIT encoding.akr2014-10-161-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/envutil.rb (assert_pattern_list): Show number of matchedakr2014-10-162-1/+7
| | | | | | | | patterns and characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: abort if nesting reserved signalnobu2014-10-161-9/+39
| | | | | | | * signal.c (check_reserved_signal): abort if reserved signal received in reserved signal handlers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c (fiber_store): fix WIN32 fibersnormal2014-10-162-1/+6
| | | | | | [ruby-core:65745] [ruby-core:65758] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: do not use disposed stringnobu2014-10-163-1/+13
| | | | | | | * parse.y (parser_here_document): do not append already appended and disposed code fragment. [ruby-dev:48647] [Bug #10392] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/-ext-/bug_reporter/test_bug_reporter.rb: fix racenormal2014-10-162-1/+6
| | | | | | | | | Signal delivery is not immediate, so wait for signal delivery. * test/-ext-/bug_reporter/test_bug_reporter.rb (test_bug_reporter_add): fix race git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_rubyoptions.rb: fix racenormal2014-10-162-1/+5
| | | | | | | | | Signal delivery is not guaranteed to be immediate, a process may exit before receiving signal it sent itself. * test/ruby/test_rubyoptions.rb (test_segv_test): fix race git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c: fix typedefnobu2014-10-161-1/+1
| | | | | | | * cont.c (rb_fiber_struct): remove useless typedef. [Feature #10341] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c: fix compile errornobu2014-10-162-1/+6
| | | | | | | * cont.c (rb_fiber_t): fix compile error caused by move to vm_core.h at r47964. [Feature #10341] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_process.rb: avoid killing wrong parentnormal2014-10-162-1/+7
| | | | | | | We must capture intended target PID before forking, since Process.ppid may change if parent dies (e.g. due to timeout) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c: fix when FIBER_USE_NATIVE is 0normal2014-10-152-1/+9
| | | | | | * cont.c (fiber_store): restore references to next_fib (fix typo) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c: fix build when FIBER_USE_NATIVE is 0normal2014-10-152-5/+6
| | | | | | * cont.c (fiber_store): remove references to nextfib git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2014-10-151-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c: Optimize fiber_switch calleesnormal2014-10-154-103/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove some unnecessary VALUE/struct conversions and aggressively inline functions used during fiber_switch. Either of these changes alone does not yield significant performance increase, but in combination they improve performance by ~6%. Arguably, removal of separate VALUE/rb_fiber_t* variables also makes the code more readable in a few places. * vm_core.h: declare rb_fiber_t typedef (rb_thread_t): fiber and root_fiber become rb_fiber_t * (from VALUE) * vm.c (rb_thread_mark): use rb_fiber_mark_self * cont.c (rb_fiber_t): prev becomes rb_fiber_t * (from VALUE) (cont_mark, cont_free): simplify conditions (rb_fiber_mark_self): new function (fiber_mark): use rb_fiber_mark_self (cont_save_thread, cont_restore_thread): inline (cont_restore_thread): simplify (fiber_setcontext): simplify conditions (rb_cont_call): remove dereference (fiber_t_alloc): update for rb_fiber_t->prev type change (rb_fiber_start): ditto (fiber_current): extract from rb_fiber_current (return_fiber): move, simplify type checks (rb_fiber_current): use fiber_current (fiber_store): simplify type checks (fiber_switch): ditto, simplify call to fiber_setcontext, use fiber_current (rb_fiber_transfer): update for type changes (rb_fiber_terminate): move, use fiber_switch (rb_fiber_resume): update for type changes (rb_fiber_reset_root_local_storage): ditto (rb_fiber_yield): use rb_fiber_switch instead of rb_fiber_transfer (rb_fiber_m_transfer): ditto [ruby-core:65518] [Feature #10341] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c (cont_save_thread): Sparse copying of thread datanormal2014-10-152-8/+39
| | | | | | | | | | | | | Instead of copying the complete rb_thread_t struct (almost a kB), selectively copy only those fields that will be needed later on. * cont.c (rb_context_t): comment on saved_thread (cont_save_thread): sparse copy (cont_init): copy extra fields (fiber_init): use current thread VM stack size [ruby-core:65518] [Feature #10341] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c: Small code cleanupnormal2014-10-152-3/+7
| | | | | | | | | | | | Remove variable that is used only once, several lines after initialization. * cont.c (cont_capture): remove unnecessary variable [ruby-core:65518] [Feature #10341] Author: Knut Franke <Knut.Franke@gmx.de> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c: Code cleanup in fiber_switch/fiber_storenormal2014-10-152-42/+46
| | | | | | | | | | | | | | | | | | | | Defragment code blocks depending on FIBER_USE_NATIVE in order to make the control flow (which is already non-trivial due to nonlocal jumps) in each case more comprehensible. Remove some unreachable code from fiber_switch (we've already excluded the case (th->fiber == fibval) at the start of the function). Remove call to rb_fiber_current which happened a few lines after accessing GET_THREAD()->fiber directly (so if that's ever 0 we're already screwed). Author: Knut Franke <Knut.Franke@gmx.de> * cont.c (fiber_store, fiber_switch): simplify [ruby-core:65518] [Feature #10341] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2014-10-16svn2014-10-151-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c: Remove unused prev_fiber/next_fiber fieldsnormal2014-10-152-27/+8
| | | | | | | | | | | | | | | | They were added in r19890 (8a0d53a), with the explanation that it's a double linked list of fibers in the same thread, but without any code using them. * cont.c (rb_fiber_t): remove prev_fiber/next_fiber (fiber_link_join, fiber_link_remove): remove functions (fiber_free, fiber_init, root_fiber_alloc): remove references to removed fields and functions [ruby-core:65518] [Feature #10341] Author: Knut Franke <Knut.Franke@gmx.de> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_backtrace.c: fix unknown ID namenobu2014-10-151-0/+9
| | | | | | | | * vm_backtrace.c (id2str): adapt rb_id2str which returns 0 on unknown ID to return Qnil, since oldbt_arg functions expect Qnil on unknown method names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_backtrace.c: unknown name methodnobu2014-10-151-4/+8
| | | | | | | * vm_backtrace.c (location_format): adjust unknown name method results to other functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos [ci skip]kazu2014-10-151-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/etc/etc.c (etc_nprocessors_affin): Test CPU_ALLOC availability.akr2014-10-152-2/+7
| | | | | | | | CentOS 5 don't have CPU_ALLOC(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Simplify multiline condition.akr2014-10-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Simplify a regexp.akr2014-10-151-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Unused variable removed.akr2014-10-151-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/etc/etc.c (etc_nprocessors_affinity): use sched_getaffinityakr2014-10-153-0/+83
| | | | | | | | | | | | | for getting precious number of available cpus. * ext/etc/etc.c (etc_nprocessors): use etc_nprocessors_affinity if possible. [Feature #10267] etc-nprocessors-kosaki2.patch git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/envutil.rb (assert_pattern_list) Renamed fromakr2014-10-154-9/+39
| | | | | | | | | | | | assert_regexp_list. Show multiline string in multi lines. * test/-ext-/bug_reporter/test_bug_reporter.rb: Use assert_pattern_list. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enum.c: nil if no iterationnobu2014-10-152-0/+2
| | | | | | | * enum.c (enum_inject): return nil if no iteration, instead of Qundef. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_rubyoptions.rb: split regexpsnobu2014-10-151-1/+2
| | | | | | | * test/ruby/test_rubyoptions.rb (SEGVTest::ExpectedStderrList): split backtrace information regexps. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enum.c: use Qundefnobu2014-10-151-8/+7
| | | | | | * enum.c (enum_inject): use Qundef for no initial values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/envutil.rb (assert_regexp_list): New assertion method.akr2014-10-153-10/+40
| | | | | | | | * test/ruby/test_rubyoptions.rb: Use assert_regexp_list. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Extract assert_segv and split the big regexp.akr2014-10-151-35/+58
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c: min(n) drops elements bigger than the n-th maximum element.akr2014-10-142-1/+26
| | | | | | | | | | (struct nmin_data): New field to record the n-th maximumelement, limit (nmin_filter): Update limit field. (nmin_i): Drop too big eleents. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_optimization.rb (test_string_size): new testnormal2014-10-142-0/+9
| | | | | | String#size may be overridden, so test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_optimization.rb: redefinition tests for Stringnormal2014-10-142-0/+24
| | | | | | | * test/ruby/test_optimization.rb (test_string_eq_neq): new test (test_string_ltlt): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e