summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-11-01Pathname: get rid of a -Wcomment warning [DOC]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01file.c: infect from argumentsnobu
* file.c (rb_check_realpath_internal): infetct the result with arguments, no taint if none are tainted and cwd is not used. [ruby-core:83583] [Bug #14060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01revert r60596 because it cause faulure on TestFile#test_realpath_taintednessko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01dir.c: cast to suppress a warningnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01file.c: infect from argumentsnobu
* file.c (rb_check_realpath_internal): infetct the result with arguments, no taint if none are tainted and cwd is not used. [ruby-core:83583] [Bug #14060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01dir: Dir.mkdir and Dir.rmdir release GVLnormal
This avoids blocking the entire VM when operating on slow or unreliable filesystems. Instead, only the thread performing the mkdir or rmdir operation is blocked and other threads are free to proceed. * dir.c (nogvl_mkdir): new function (nogvl_rmdir): ditto (dir_s_mkdir): release GVL (dir_s_rmdir): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31Pathname: Simplify example [DOC] [ci-skip]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31* 2017-11-01svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31use mode_t where applicable (instead of int)normal
mode_t is the correct type for these syscalls and it can be easier-to-understand. It may also help portability to future platforms and improve type checking. * dir.c (dir_s_mkdir): use mode_t for mkdir(2) * file.c (chmod_internal): use mode_t for chmod(2) (rb_file_s_chmod): s/int/mode_t/ (lchmod_internal): ditto, deref pointer as in chmod_internal (rb_file_s_lchmod): pass pointer as in rb_file_s_chmod (rb_file_s_rename): use mode_t for umask(2) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31node.h: Rename nd_reserved to nd_locationyui-knk
* node.h (RNode): Now nd_reserved is used to store location information, so rename nd_reserved to nd_location. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31compile.c: ensure after return in library toplevelnobu
* compile.c (compile_return): execute ensure clause after toplevel return even in library toplevel other than the main script. [ruby-core:83589] [Bug #14061] test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31compile.c: compile_returnnobu
* compile.c (compile_return): extract from iseq_compile_each. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31null byte at Psych::Emitter.hsbt
Check null byte. Patched by tommy (Masahiro Tomita). [Bug #13993][ruby-dev:50285] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31Remove unneeded complexitymame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31webrick/httpresponse: minor cleanups to reduce memory usenormal
I never knew "format" was a global method alias for "sprintf"; so it was confusing to me. Normally, one would use "sprintf" since it's also available in many other languages, but Integer#to_s avoids parsing a format string so it's less bug-prone. Furthermore, favor string interpolation over String#<< since it is easier for the VM to optimize memory allocation (as in r60320). Interpolation also reduces method calls and memory overhead for inline method cache. Finally, ensure we clear all short-lived buffers for body responses. A similar change was made and measured for Net::* in r58840 showing a large memory reduction on some workloads. * webrick/httpresponse.rb (send_body_io): favor String#to_s, reduce method calls for String#<<, clear `buf' when done, avoid extra String#bytesize calls * (send_body_string): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31Use NODE_CASE2 if case expressions don't existyui-knk
When NODE_WHEN is compiled by iseq_compile_each0, the node passed to compile_when is NODE_WHEN (not NODE_CASE). So we can not handle the location of NODE_CASE of case statements which don't have case expressions. e.g. : ``` case; when 1; foo; when 2; bar; else baz; end ``` This commit adds NODE_CASE2, and compiles it by iseq_compile_each0. * compile.c (compile_case): Does not call COMPILE_ when NODE_CASE does not have case expressions. * compile.c (compile_case2): Compile NODE_CASE2 by compile_case2. * compile.c (compile_when): Delete an obsoleted function. * compile.c (iseq_compile_each0): Compile NODE_CASE2. * ext/objspace/objspace.c (count_nodes): Add NODE_CASE2 case. * node.c (dump_node, rb_gc_mark_node): Add NODE_CASE2 case. * node.h (node_type): Add NODE_CASE2. * node.h (NEW_CASE2): Add a macro which generates NODE_CASE2. * parse.y: Generate NODE_CASE2 if case expressions don't exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30webrick: support Proc objects as body responsesnormal
* lib/webrick/httpresponse.rb (send_body): call send_body_proc (send_body_proc): new method (class ChunkedWrapper): new class * test/webrick/test_httpresponse.rb (test_send_body_proc): new test (test_send_body_proc_chunked): ditto [Feature #855] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30dir: Dir.chdir releases GVLnormal
chdir(2) is subject to all the pathological slowdowns and caveats as open(2) on slow or unreliable filesystems, so ensure other threads can proceed while this is happening. * dir.c (nogvl_chdir): new function * dir.c (dir_chdir): release GVL git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30* 2017-10-31svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30Use nd_lineno instead of nd_line for branch coveragesyui-knk
* compile.c (compile_if, compile_case, compile_loop, iseq_compile_each0): Use nd_lineno of nodes for branch coverages. nd_lineno is not adjusted line number of nodes. Sometimes nd_line is adjusted by fixpos. These adjustments lead to confusing result. For example, lineno of NODE_IF is 1, but line is 2 (line number is one-based). ``` ;;;;;;;;;;;;;;;;;;;;if 1 + 1 2 end ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30Store lineno on RNodeyui-knk
* node.c (A_NODE_HEADER): Print lineno. * node.h (nd_column, nd_set_column): Store column number with 16-bit. * node.h (nd_lineno, nd_set_lineno): Define getter/setter macros for lineno of RNode. * parse.y : Set first lineno of tokens. Thanks to takeshinoda for review. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30backward.h: rb_frame_method_id_and_classnobu
* include/ruby/backward.h (rb_frame_method_id_and_class): moved a deprecated declaration from intern.h, for r60558. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30rbinstall.rb: show categories of default gemsnobu
* tool/rbinstall.rb (#install_default_gem): show categories of default gems, pure ruby libraries and libraries with extensions. [ruby-core:83600] [Bug #14065] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30stop refine_spec because it causes double free errorko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29Remove duplicated column setyui-knk
* parse.y : Column of resq is set by new_resbody, so this line is needless. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29parse.y (new_regexp_gen): Set column for NODE_SCOPEyui-knk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29string.c: improve docsstomar
* string.c: [DOC] fix rdoc for cross reference; fix grammar. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29lib/set.rb: improve docs for Set#===stomar
* lib/set.rb: [DOC] improve description and examples for Set#===. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29io.c: improve docsstomar
* io.c: [DOC] fix rdoc for some cross references; fix grammar. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29io.c: docs for IO#writestomar
* io.c: [DOC] fix example and language in IO#write docs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29doc/contributors.rdoc: [DOC] updatestomar
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29complex.c: doc fixstomar
* complex.c: [DOC] fix grammar and typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29Clarify what is written and read in IO#popen speceregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29Fix spec which can fail if the pipe is closed before flushing in the subprocesseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29* vm_dump.c (vm_stack_dump_each): accepts `ec`.ko1
* vm_dump.c (vm_base_ptr): constify. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29* node.h (ast_t): renamed to `rb_ast_t`.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29* eval_jump.c (rb_exec_end_proc): use `GET_EC()`.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29call `rb_vm_stack_to_heap()`ko1
* safe.c (rb_set_safe_level): call `rb_vm_stack_to_heap()` to set block parameter. * safe.c (rb_set_safe_level): use `GET_EC()`. * safe.c (safe_setter): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29* vm_insnhelper.h (GET_SP_COUNT): removed because nobody use it.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29* vm_eval.c (current_vm_stack_arg): accepts `ec`.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29use given `ec`.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29constify `rb_vm_bh_to_procval()`ko1
* vm_insnhelper.c (rb_vm_bh_to_procval): constify 1st param (ec). * vm_args.c (args_setup_block_parameter): accepts (const) `ec`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29remove unused functions.ko1
* vm.c (rb_frame_method_id_and_class): removed because nobody use it. * vm.c (rb_thread_current_status): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29use `GET_EC()`.ko1
* eval.c (rb_block_given_p): use `GET_EC()` directly. * eval.c (rb_ensure): ditto. * eval.c (rb_errinfo): ditto. * eval.c (previous_frame): accepts `ec` instead of `th`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29* vm_eval.c (vm_catch_protect): accepts `ec` instead of `th`.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29* 2017-10-30svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29use `GET_EC()`.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29use `GET_EC()`.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29`th` -> `ec` for `rb_iterate0`.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29`th` -> `ec` for rb_raise_method_missing().ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e