aboutsummaryrefslogtreecommitdiffstats
path: root/ext/-test-
Commit message (Collapse)AuthorAgeFilesLines
* Clear all trace events during teardownAlan Wu2020-03-301-0/+8
| | | | | | | | | | | | | Since 0c2d81dada, not all trace events are cleared during VM teardown. This causes a crash when there is a tracepoint for `RUBY_INTERNAL_EVENT_GC_EXIT` active during teardown. The commit looks like a refactoring commit so I think this change was unintentional. [Bug #16682] (cherry picked from commit b385f7670ffa420790bc548747fa4b58c4c5d8f6)
* Return the makefile contentNobuyoshi Nakada2020-02-131-0/+1
| | | | | Block for `create_makefile` is expected to return the content of the makefile.
* Move .IGNORE in extconf.rbNARUSE, Yui2020-02-132-3/+1
|
* Support nmakeNARUSE, Yui2020-02-131-0/+2
|
* Ignore expected errors on compiling C++ source [Bug #16331]NARUSE, Yui2020-02-131-0/+1
| | | | | | | | | | | | | | BSD make can run parallel more aggressively than GNU make. It communicate with other make process through -J option in MAKEFLAGS environment variable to notify a build failure happend in an other pararell make process. https://www.freebsd.org/cgi/man.cgi?make It usually works well but ext/-test-/cxxanyargs/Makefile has two targets which are expected to fail (failure.o and failurem1.o). Additional note: To test and debug this issue, following command will speed up it. `make -f exts.mk -j8 clean all`
* check interrupts at each frame pop timing.Koichi Sasada2019-11-291-1/+17
| | | | | | | | | | | | | | | | | | Asynchronous events such as signal trap, finalization timing, thread switching and so on are managed by "interrupt_flag". Ruby's threads check this flag periodically and if a thread does not check this flag, above events doesn't happen. This checking is CHECK_INTS() (related) macro and it is placed at some places (laeve instruction and so on). However, at the end of C methods, C blocks (IMEMO_IFUNC) etc there are no checking and it can introduce uninterruptible thread. To modify this situation, we decide to place CHECK_INTS() at vm_pop_frame(). It increases interrupt checking points. [Bug #16366] This patch can introduce unexpected events...
* Check -1 arity for C++Nobuyoshi Nakada2019-11-223-5/+23
|
* Revert the line for nextafter.c for FreeBSD makeNobuyoshi Nakada2019-11-201-0/+3
|
* Update dependenciesNobuyoshi Nakada2019-11-188-60/+59
|
* Remove unneeded exec bits from some filesDavid Rodríguez2019-11-093-0/+0
| | | | | | | | | | | | | I noticed that some files in rubygems were executable, and I could think of no reason why they should be. In general, I think ruby files should never have the executable bit set unless they include a shebang, so I run the following command over the whole repo: ```bash find . -name '*.rb' -type f -executable -exec bash -c 'grep -L "^#!" $1 || chmod -x $1' _ {} \; ```
* Moved RB_METHOD_DEFINITION_DECL to intern.hNobuyoshi Nakada2019-10-121-0/+204
| | | | This macro is used here before defined in ruby.h.
* atime may not updated unless strictatime is set on macOS CatalinaNobuyoshi Nakada2019-10-121-0/+3
| | | | | | | | | | | | | Cited from mount(8): ``` strictatime Always update the file access time when reading from a file. Without this option the filesystem may default to a less strict update mode, where some access time updates are skipped for performance reasons. This option could be ignored if it is not supported by the filesystem. ```
* ext/-test-/enumerator_kw/enumerator_kw.c: remove unused variableYusuke Endoh2019-10-011-1/+1
|
* Add rb_enumeratorize_with_size_kw and related macrosJeremy Evans2019-09-303-0/+36
| | | | | | | | | | Currently, there is not a way to create a sized enumerator in C with a different set of arguments than provided by Ruby, and correctly handle keyword arguments. This function allows that. The need for this is fairly uncommon, but it occurs at least in Enumerator.produce, which takes arugments from Ruby but calls rb_enumeratorize_with_size with a different set of arguments.
* Add three more C-API functions for handling keywordsJeremy Evans2019-09-291-2/+30
| | | | | | | | This adds rb_funcall_passing_block_kw, rb_funcallv_public_kw, and rb_yield_splat_kw. This functions are necessary to easily handle cases where rb_funcall_passing_block, rb_funcallv_public, and rb_yield_splat are currently used and a keyword argument separation warning is raised.
* Fix more keyword separation issuesJeremy Evans2019-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | This fixes instance_exec and similar methods. It also fixes Enumerator::Yielder#yield, rb_yield_block, and a couple of cases with Proc#{<<,>>}. This support requires the addition of rb_yield_values_kw, similar to rb_yield_values2, for passing the keyword flag. Unlike earlier attempts at this, this does not modify the rb_block_call_func type or add a separate function type. The functions of type rb_block_call_func are called by Ruby with a separate VM frame, and we can get the keyword flag information from the VM frame flags, so it doesn't need to be passed as a function argument. These changes require the following VM functions accept a keyword flag: * vm_yield_with_cref * vm_yield * vm_yield_with_block
* Make rb_scan_args handle keywords more similar to Ruby methods (#2460)Jeremy Evans2019-09-251-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cfuncs that use rb_scan_args with the : entry suffer similar keyword argument separation issues that Ruby methods suffer if the cfuncs accept optional or variable arguments. This makes the following changes to : handling. * Treats as **kw, prompting keyword argument separation warnings if called with a positional hash. * Do not look for an option hash if empty keywords are provided. For backwards compatibility, treat an empty keyword splat as a empty mandatory positional hash argument, but emit a a warning, as this behavior will be removed in Ruby 3. The argument number check needs to be moved lower so it can correctly handle an empty positional argument being added. * If the last argument is nil and it is necessary to treat it as an option hash in order to make sure all arguments are processed, continue to treat the last argument as the option hash. Emit a warning in this case, as this behavior will be removed in Ruby 3. * If splitting the keyword hash into two hashes, issue a warning, as we will not be splitting hashes in Ruby 3. * If the keyword argument is required to fill a mandatory positional argument, continue to do so, but emit a warning as this behavior will be going away in Ruby 3. * If keyword arguments are provided and the last argument is not a hash, that indicates something wrong. This can happen if a cfunc is calling rb_scan_args multiple times, and providing arguments that were not passed to it from Ruby. Callers need to switch to the new rb_scan_args_kw function, which allows passing of whether keywords were provided. This commit fixes all warnings caused by the changes above. It switches some function calls to *_kw versions with appropriate kw_splat flags. If delegating arguments, RB_PASS_CALLED_KEYWORDS is used. If creating new arguments, RB_PASS_KEYWORDS is used if the last argument is a hash to be treated as keywords. In open_key_args in io.c, use rb_scan_args_kw. In this case, the arguments provided come from another C function, not Ruby. The last argument may or may not be a hash, so we can't set keyword argument mode. However, if it is a hash, we don't want to warn when treating it as keywords. In Ruby files, make sure to appropriately use keyword splats or literal keywords when calling Cfuncs that now issue keyword argument separation warnings through rb_scan_args. Also, make sure not to pass nil in place of an option hash. Work around Kernel#warn warnings due to problems in the Rubygems override of the method. There is an open pull request to fix these issues in Rubygems, but part of the Rubygems tests for their override fail on ruby-head due to rb_scan_args not recognizing empty keyword splats, which this commit fixes. Implementation wise, adding rb_scan_args_kw is kind of a pain, because rb_scan_args takes a variable number of arguments. In order to not duplicate all the code, the function internals need to be split into two functions taking a va_list, and to avoid passing in a ton of arguments, a single struct argument is used to handle the variables previously local to the function.
* Fix for explicit cast without RUBY_METHOD_FUNCNobuyoshi Nakada2019-09-201-0/+7
|
* Check various method defitions in C++Nobuyoshi Nakada2019-09-201-0/+44
|
* Get rid of embedding make command lineNobuyoshi Nakada2019-09-201-2/+3
| | | | | NMAKE sets MAKE to the full path name, which includes spaces by the default installation.
* Fixed cxxanyargs/dependNobuyoshi Nakada2019-09-201-4/+4
| | | | | * Removed excess backslashes * Fixed the target name to try failure.cpp
* Moved unmatch arity check to depend fileNobuyoshi Nakada2019-09-192-12/+9
| | | | To substitute suffixes and VPATH for nmake.
* Ensure that unmatched arity fails in C++Nobuyoshi Nakada2019-09-192-1/+27
|
* Removed mkmf.log dump in MakefileNobuyoshi Nakada2019-09-191-5/+0
|
* DEBUG: cxxanyargsNobuyoshi Nakada2019-09-191-0/+3
|
* DEBUG: cxxanyargsNobuyoshi Nakada2019-09-192-1/+2
|
* DEBUGNobuyoshi Nakada2019-09-191-0/+1
|
* Look up the language moduleNobuyoshi Nakada2019-09-191-1/+1
| | | | | | Look up language module with `MakeMakefile.[]`, insted of a accessing constant under that module directly, to get rid of expose the constant to the toplevel inadvertently.
* Removed unused keyword argument [ci skip]Nobuyoshi Nakada2019-09-191-1/+1
|
* [EXPERIMENTAL] MakeMakefile::CXX for C++Nobuyoshi Nakada2019-09-181-20/+5
|
* Pass keyword argument flag when rb_call_super_kw calls method_missingJeremy Evans2019-09-173-0/+29
| | | | | | | | This makes method_missing take a flag for whether keyword arguments were passed. Adds tests both for rb_call_super_kw usage as well as general usage of super calling method_missing in Ruby methods.
* add minimaist C++ check卜部昌平2019-09-091-2/+41
| | | | | | | | | | This is a test extension so we basically want test failures rather than a configure breakage but if there is no C++ compiler, we need no test at all because there will be no chance for the tested header file to be used later. This makes it possible to build the ruby binary without any C++ compiler installed in a build environment.
* static member variables must explictly be initialized卜部昌平2019-09-091-0/+2
| | | | | | These variables then get their room for storage. See also https://github.com/ruby/ruby/runs/214042030
* Revert "save committers' weekend from CI failures"卜部昌平2019-09-093-0/+378
| | | | This reverts commit 53d21087da078cf999cc4757b03b2ff0fab4c2cf.
* save committers' weekend from CI failures卜部昌平2019-09-063-378/+0
| | | | Kill the failing tests.
* avoid name mangling卜部昌平2019-09-061-1/+1
| | | | | Otherwise the dynamic linker cannot find this function. See also https://ci.appveyor.com/project/ruby/ruby/builds/27224231/job/4pg6lxlsnsjotu2l
* nullptr is a C++11ism.卜部昌平2019-09-061-2/+3
| | | | | Should use numeric 0 for maximum portability. See also https://travis-ci.org/ruby/ruby/jobs/581543798
* fix Visual Studio compilation error卜部昌平2019-09-061-1/+1
| | | | See also https://github.com/ruby/ruby/runs/213964487
* add test for cxxanyargs.hpp卜部昌平2019-09-063-0/+377
|
* fix arity of bug_start卜部昌平2019-08-291-1/+1
| | | | | This is just a trivial mistake introduced in 0f36e8fc03a5c6433972d6bb5f177d5f6e106bac.
* st_foreach now free from ANYARGS卜部昌平2019-08-272-3/+2
| | | | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from st_foreach. I strongly believe that this commit should have had come with b0af0592fdd9e9d4e4b863fde006d67ccefeac21, which added extra parameter to st_foreach callbacks.
* rb_ensure now free from ANYARGS卜部昌平2019-08-271-1/+1
| | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_ensure, which also revealed many arity / type mismatches.
* Warn instance variable `E`Nobuyoshi Nakada2019-08-101-3/+12
| | | | It is not dumped, as it is a short alias for `:encoding`.
* ext/-test-/bug-14834/bug-14384.c: fallback for MAYBE_UNUSEDYusuke Endoh2019-08-011-0/+4
| | | | | __unused__ is unavailable on Sun C. https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20190801T112505Z.fail.html.gz
* fix VC 2013 compile error卜部昌平2019-08-011-2/+2
| | | | | It seems the compiler does not support VLAs. See also: https://ci.appveyor.com/project/ruby/ruby/builds/26392589/job/px6nuiuw4e78weg1
* fix tracepoint + backtrace SEGV卜部昌平2019-08-013-0/+51
| | | | | | | | | | | | PC modification in gc_event_hook_body was careless. There are (so to say) abnormal iseqs stored in the cfp. We have to check sanity before we touch the PC. This has not been fixed because there was no way to (ab)use the setup from pure-Ruby. However by using our official C APIs it is possible to touch such frame(s), resulting in SEGV. Fixes [Bug #14834].
* Include ruby/assert.h in ruby/ruby.h so that assertions can be thereNobuyoshi Nakada2019-07-1444-0/+88
|
* Added depend filesNobuyoshi Nakada2019-07-1428-0/+452
|
* Fixed inadvertent ID creation in rb_iv_getNobuyoshi Nakada2019-07-011-0/+8
|
* Update dependenciesNobuyoshi Nakada2019-05-131-0/+11
|