aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* lib/irb.rb: fix up r65674kazu2018-11-121-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ~(unsigned char) is not unsigned charshyouhei2018-11-121-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | The unary ~ operator excercises integer promotion of the operand _before_ actually applying bitwise complement (cf: ISO/IEC 9899:1990 section 6.3.3.3). Which means `~buf[i]` is in fact `(int)~(int)buf[i]`. The problem is, when buf[i] is 0xFF: buf[i] 0xFF (int)buf[i] 0x0000_00FF ~(int)buf[i] 0xFFFF_FF00 This is -256, out of unsigned char range. The proposed fix is to change the char signed. By doing so, buf[i] 0xFF (signed char)buf[i] 0xFF (int)(signed char)buf[i] 0xFFFF_FFFF ~(int)(signed char)buf[i] 0x0000_0000 This is 0, does not overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Document binding.irb on Binding [ci skip]k0kubun2018-11-121-1/+57
| | | | | | | | | | | | | | | | For some reason this very useful method was undocumented since it was added in 493e48897421d176a8faf0f0820323d79ecdf94a which makes finding it in the docs impossible before this change. I've added a detailed example with sample code because it's one of the most powerful tools to debug Ruby code and I believe very few people are aware of it due to the lack of documentation. [Fix GH-2010] From: Olivier Lacan <hi@olivierlacan.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2018-11-120-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge Bundler-2.0.0.pre1 from upstream.hsbt2018-11-1236-95/+90
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* erb.rb: warn invalid trim_mode [Misc #15294]k0kubun2018-11-122-1/+32
| | | | | | From: Justin Collins <justin@presidentbeef.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-11-12svn2018-11-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/setup.mak: Substitute slashes in `MJIT_CC`nobu2018-11-111-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* `MJIT_BUILD_DIR` is not used on Windowsnobu2018-11-111-1/+0
| | | | | | Because `LOAD_RELATIVE` is always enabled on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix for bison 3.2 [Bug #15284]nobu2018-11-111-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add docs to RubyVM::AbstractSyntaxTree.ofyui-knk2018-11-111-0/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix a typo [ci skip]nobu2018-11-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use friendlier terminology in leaf helpersnobu2018-11-111-6/+6
| | | | | | | | [Fix GH-2009] From: Juanito Fatas <juanito.fatas@shopify.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Make some functions to be staticyui-knk2018-11-111-7/+7
| | | | | | These functions are used only in ast.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use friendlier terminology in rubysocket.h commentnobu2018-11-111-1/+1
| | | | | | | | [Fix GH-2008] From: Juanito Fatas <juanito.fatas@shopify.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Use friendlier terminology in rubysocket.h comment"nobu2018-11-111-1/+1
| | | | | | This reverts commit dcd41bbbdb021b5e0e74f8a33c2c58cecf595f29. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use friendlier terminology in rubysocket.h commentnobu2018-11-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Make rubygems follow the upstream of psychnobu2018-11-113-37/+37
| | | | | | And merge psych again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Merge psych from upstream."mame2018-11-102-32/+32
| | | | | | | | This reverts commit db3101ff301b8e6f52170df0891f4fc35579354f. This caused build error: http://ci.rvm.jp/results/trunk-test@ruby-sky3/1452708 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-11-11svn2018-11-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge psych from upstream.hsbt2018-11-102-32/+32
| | | | | | * https://github.com/ruby/psych/pull/378 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Constified ruby_sourcefilenobu2018-11-101-1/+1
| | | | | | | which usually refers ruby_sourcefile_string and is not freed directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* AST.of -e scriptnobu2018-11-102-0/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Parse the source in SCRIPT_LINES__ as arraynobu2018-11-103-8/+57
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Check the argument before creating a parsernobu2018-11-101-29/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Parse the source in SCRIPT_LINES__ if possiblenobu2018-11-101-2/+21
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix potential NULL pointer access [ci skip]nobu2018-11-101-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-11-10svn2018-11-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_pthread.c (rb_sigwait_sleep): add note about spurious wakeupnormal2018-11-091-0/+3
| | | | | | | I already forgot why we needed to jump through such hoops :x [ruby-core:88102] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Get rid of setting SCRIPT_LINES__ by AST.parsenobu2018-11-093-6/+33
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Hoisted out rb_ast_parse_str and rb_ast_parse_filenobu2018-11-091-1/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove unused default value of MJIT_CC [ci skip]kazu2018-11-091-1/+1
| | | | | | because always set `MJIT_CC` at `: ${MJIT_CC=$CC}` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* addr2line.c: fix compilation for i386-darwinnobu2018-11-091-12/+23
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* util.c: suppress warningsshyouhei2018-11-091-0/+2
| | | | | | | | These functions handle overflows correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: avoid division by zeroshyouhei2018-11-091-11/+43
| | | | | | | | | | | | | | | | | | | In C, division by zero is undefined, even if the expression is double (cf: ISO/IEC 9899:1990 section 6.3.5). OTOH we have tests about such operations and results, means we expect no exceptional situation shall occur. We need to carefully reroute the situation, and generate what is needed. See also: https://travis-ci.org/ruby/ruby/jobs/452680646#L2943 PS: Recently (last two decades), C have Annex. F document. It normatively specifies that the division operator is IEEE 754's division operator (cf: ISO/IEC 9899:1999 section F.3). If we could move to such newer version this could be no problem. But that is not possible today. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Rename `AST` module to `AbstractSyntaxTree`yui-knk2018-11-093-37/+37
| | | | | | Follow the same naming convention of `InstructionSequence` class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2018-11-092-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* There is a path to use bmethod with ifunc.ko12018-11-092-6/+8
| | | | | | | | * vm_insnhelper.c (vm_yield_with_cfunc): use passed me as bmethod. We also need to set `VM_FRAME_FLAG_BMETHOD` if needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-11-09svn2018-11-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2018-11-091-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix passing wrong `passed_bmethod_me`.ko12018-11-093-17/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * vm_core.h: remove `rb_execution_context_t::passed_bmethod_me` and fix functions to pass the `me` directly. `passed_bmethod_me` was used to make bmethod (methods defined by `defined_method`). `rb_vm_invoke_bmethod` invoke `Proc` with `me` information as method frame (`lambda` frame, actually). If the proc call is not bmethod call, `passed_bmethod_me` should be NULL. However, there is a bug which passes wrong `me` for normal block call. http://ci.rvm.jp/results/trunk-asserts@silicon-docker/1449470 This is because wrong `me` was remained in `passed_bmethod_me` (and used incorrectly it after collected by GC). We need to clear `passed_bmethod_me` just after bmethod call, but clearing is not enough. To solve this issue, I removed `passed_bmethod_me` and pass `me` information as a function parameter of `rb_vm_invoke_bmethod`, `invoke_block_from_c_proc` and `invoke_iseq_block_from_c` in vm.c. * vm.c (invoke_iseq_block_from_c): the number of parameters is too long so that I try to specify `ALWAYS_INLINE`. * vm.c (invoke_block_from_c_proc): ditto. * vm_insnhelper.c (vm_yield_with_cfunc): now there are no pathes to use bmethod here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st.c: bin might be zeroshyouhei2018-11-081-1/+1
| | | | | | | | | When EMPTY_OR_DELETED_BIN_P(bin) is true, it is a wrong idea to subtract ENTRY_BASE from it. Delay doing so until we are sure to be safe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2018-11-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: avoid integer overflow at process exitshyouhei2018-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is rather nitpicking but at the moment the process terminates, heap_pages_final_slots overflows. (lldb) bt * thread #1: tid = 0xc0903, 0x00000001002b3bf7 miniruby`finalize_list(objspace=0x0000000101c09240, zombie=4329149840) + 999 at gc.c:2946, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) * frame #0: 0x00000001002b3bf7 miniruby`finalize_list(objspace=0x0000000101c09240, zombie=4329149840) + 999 at gc.c:2946 frame #1: 0x000000010026a69e miniruby`rb_objspace_call_finalizer(objspace=0x0000000101c09240) + 7118 at gc.c:3092 frame #2: 0x0000000100268ac5 miniruby`rb_gc_call_finalizer_at_exit + 149 at gc.c:3015 frame #3: 0x00000001002272bc miniruby`ruby_finalize_1 + 156 at eval.c:146 frame #4: 0x00000001002282b6 miniruby`ruby_cleanup(ex=0) + 4070 at eval.c:238 frame #5: 0x0000000100228785 miniruby`ruby_run_node(n=0x0000000102060ad8) + 85 at eval.c:317 frame #6: 0x0000000100000b9c miniruby`main(argc=2, argv=0x00007fff5fbfdc38) + 124 at main.c:42 frame #7: 0x00007fff9966a5ad libdyld.dylib`start + 1 frame #8: 0x00007fff9966a5ad libdyld.dylib`start + 1 (lldb) p objspace->heap_pages (rb_objspace::(anonymous struct)) $0 = { sorted = 0x0000000101c070b0 allocated_pages = 24 allocatable_pages = 0 sorted_length = 24 range = { [0] = 0x0000000102020028 [1] = 0x00000001020dbfd0 } freeable_pages = 0 final_slots = 0 deferred_final = 4329149840 } (lldb) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c: +(-1) is a wrong ideashyouhei2018-11-081-1/+5
| | | | | | | | | | | | | Before this changeset RHASH_ARRAY_SIZE_DEC() was expaneded to include an expression like `RHASH_ARRAY_SIZE+(-1)`. RHASH_ARRAY_SIZE is by definition unsigned int. -1 is signed, of course. Adding a signed and an unsigned value requires the "usual arithmetic conversions" (cf: ISO/IEC 9899:1990 section 6.2.1.5). -1 is converted to 0xFFFF by that. This patch prevents that conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_core.h: conform C90k0kubun2018-11-081-1/+1
| | | | | | https://travis-ci.org/ruby/ruby/jobs/452230859 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* avoid (size_t)-- (2nd try)shyouhei2018-11-082-2/+7
| | | | | | | | | | | The decrements overflow and these variables remain ~0 when leaving the while loops. They are not fatal by accident, but better replace with ordinal for loops. See also: https://travis-ci.org/ruby/ruby/jobs/452218871#L3246 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/rubygems/indexer.rb: suppress random test-all errork0kubun2018-11-081-1/+8
| | | | | | | | by bundler. Similar to r65613, but fixing this more carefully because here is not just inside tests but inside rubygems code. http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/1448239 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* initialize VM postponed_job first. [Bug #15288]ko12018-11-082-8/+3
| | | | | | | | * inits.c: call `Init_vm_postponed_job` first because postponed_job is used by transient heap. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* svn merge -r 65625:65623 .shyouhei2018-11-082-7/+2
| | | | | | | Was breaking make test-all git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e