Commit Graph

11144 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto d8a5163b24 Support -v flag of rake; close #4887
The patch was originally written by @take-cheese. I have fixed the
conflict caused by `minirake` deletion - @matz.
2019-12-27 11:05:56 +09:00
Yukihiro "Matz" Matsumoto ed8491cde6 Numbered parameters: usually linked list uses cdr for links. 2019-12-27 11:05:56 +09:00
Yukihiro "Matz" Matsumoto 7e6355975e Prohibit numbered parameters as method arguments; fix #4892
As of CRuby2.7 it is only warned. `mruby` prohibits explicitly to
implement the future Ruby3 behavior.
2019-12-27 11:05:56 +09:00
KOBAYASHI Shuji 716102fff3 Enable MRB_GC_STRESS test on CI
The `debug` build target (`MRB_GC_STRESS` is enabled) on CI have been
compiled but not tested so far. However, I think testing with
`MRB_GC_STRESS` is effective (in fact, I found #4907 bug).

Therefore, I integrated `debug` and `full-debug` build targets to enable
`MRB_GC_STRESS` testing. Testing with `MRB_GC_STRESS` takes a little time,
but compiling takes more time, so CI execution time does not increase due to
decrease of build target.
2019-12-27 11:05:56 +09:00
Yukihiro "Matz" Matsumoto ef6805f599 Merge pull request #4864 from take-cheeze/enable_sanitizer_travis
Enable sanitizer in travis test
2019-12-27 10:58:24 +09:00
Yukihiro "Matz" Matsumoto d6b898685f Merge pull request #4907 from shuujii/fix-poteltially-use-of-wrong-method-cache
Fix potentially use of wrong method cache
2019-12-25 23:23:00 +09:00
KOBAYASHI Shuji 0b2d54f4f1 Fix potentially use of wrong method cache
#### Example (with `MRB_METHOD_CACHE`)

  ```ruby
  GC.start
  c = Class.new
  p c            #=> #<Class:0x7fd6a180e790>
  c.new          #=> cache `c.new`
  c = nil
  GC.start       #=> `c` is GCed
  r = Range.dup
  p r            #=> #<Class:0x7fd6a180e790>
                 #   [same pointer as `c`]
  r.new(2, 3)    #=> ArgumentError: 'initialize':
                 #   wrong number of arguments (2 for 0)
                 #   [`c.new` is called instead of `r.new`]
  ```

#### Cause

  An entry of method cache is identified by class pointer and method
  id. However, reusing memory after GC may create a class with the same
  pointer as the cached class.

#### Treatment

  Cleared method caches of the class when the class is GCed.
2019-12-25 21:31:10 +09:00
Yukihiro "Matz" Matsumoto d4cbe6271c Merge pull request #4906 from shuujii/refine-the-assertion-failure-message-in-mrdb-print-tests
Refine the assertion failure message in mrdb print tests
2019-12-25 10:58:04 +09:00
KOBAYASHI Shuji f92867a59e Refine the assertion failure message in mrdb print tests
#### Before this patch:

  ```console
  Fail: mruby-bin-debugger(print) error (mrbgems: mruby-bin-debugger)
   - Assertion[2]
      Expected true to be false.
  ```

#### After this patch:

  ```console
  Fail: mruby-bin-debugger(print) error (mrbgems: mruby-bin-debugger)
   - Assertion[2]
      Expected "$2 = undefined method 'bar' (NoMethodError)\n" to be start_with? "$2 = (eval):2: undefined method".
  ```
2019-12-24 23:20:20 +09:00
Yukihiro "Matz" Matsumoto d062528653 Merge pull request #4905 from kishima/cygwin_compile
Add double quotes for cygwin filenames #4904
2019-12-24 14:23:24 +09:00
kishima b63f1912df add double quotes for cygwin filenames #4904 2019-12-23 23:36:59 +09:00
Yukihiro "Matz" Matsumoto 18248cfd00 Merge pull request #4901 from take-cheeze/gnu_cxx
Use GNU extension in C++ for cygwin
2019-12-23 21:32:26 +09:00
Yukihiro "Matz" Matsumoto 0f89a91607 Merge pull request #4902 from take-cheeze/native_crlf
Handle CR LF newline natively in lexer
2019-12-23 21:31:51 +09:00
take-cheeze bb0aec1d94 Use binary mode in mrbc source code reading 2019-12-23 21:01:42 +09:00
take-cheeze 10e9f193ca Handle CR LF newline natively in lexer 2019-12-23 21:01:11 +09:00
take-cheeze 38fdca82c6 Use GNU extension in C++ for cygwin 2019-12-23 20:58:43 +09:00
Yukihiro "Matz" Matsumoto 49301ed785 Merge pull request #4900 from shuujii/parallelize-compilation-only-on-Travis-CI
Parallelize compilation only on Travis CI
2019-12-23 20:37:25 +09:00
KOBAYASHI Shuji 212d12f269 Parallelize compilation only on Travis CI
Parallel execution of tests makes log difficult to see due to mixing.
2019-12-23 20:04:11 +09:00
Yukihiro "Matz" Matsumoto a562a9aa93 Merge pull request #4899 from dearblue/build-git
Use `git checkout` instead of `git reset`
2019-12-22 22:31:33 +09:00
dearblue f08d9b288d Use git checkout instead of git reset
With this change, if the checkout fails, it will stop with an error.

The purpose is to avoid deleting working branch history when
developing gem.
2019-12-22 15:09:29 +09:00
dearblue dc15c2838f Display directory with git command 2019-12-22 14:26:00 +09:00
Yukihiro "Matz" Matsumoto 0bd3a67dea Merge pull request #4898 from shuujii/refine-.travis.yml
Refine `.travis.yml`
2019-12-22 13:13:49 +09:00
Yukihiro "Matz" Matsumoto 572958ece3 Merge pull request #4896 from shuujii/fix-undefined-method-Pathname
Fix "undefined method `Pathname'"; fix #4895
2019-12-22 13:12:59 +09:00
Yukihiro "Matz" Matsumoto fa90bcb9ab Merge pull request #4897 from shuujii/use-exec-instead-of-system-in-minirake-for-exit-status
Use `exec` instead of `system` in `minirake` for exit status
2019-12-22 13:11:23 +09:00
KOBAYASHI Shuji 5974d53ab0 Refine .travis.yml
* Use `rake` instead of `minirake`.
* Remove `gperf` configuration.

Execution time seems to be reduced by about 15%.
2019-12-22 11:48:04 +09:00
KOBAYASHI Shuji 66349bcef1 Use exec instead of system in minirake for exit status
#### Before this patch:

  ```console
  $ ./minirake --foo; echo $?
  invalid option: --foo
  0
  ```

#### After this patch:

  ```console
  $ ./minirake --foo; echo $?
  invalid option: --foo
  1
  ```
2019-12-21 23:44:33 +09:00
KOBAYASHI Shuji 9f1167f7c9 Fix "undefined method `Pathname'"; fix #4895 2019-12-21 23:31:17 +09:00
Yukihiro "Matz" Matsumoto 089bb6acad Merge pull request #4888 from dearblue/shellquote
Perform `shellquote` on referenced string
2019-12-21 22:46:27 +09:00
Yukihiro "Matz" Matsumoto 06e09fc7a9 Numbered parameters should not be available in the lambda bodies.
`mruby` does not warn like `CRuby` for cases like #4893.
Fix #4890, fix #4891, fix #4893.
2019-12-21 22:41:32 +09:00
Yukihiro "Matz" Matsumoto 2fe78a0c7c Add emulating minirake that calls real rake. 2019-12-21 22:11:08 +09:00
Yukihiro "Matz" Matsumoto de17f63b45 Abandon minirake. Use rake for compilation; fix #4884 2019-12-21 22:11:08 +09:00
Yukihiro "Matz" Matsumoto fee3c1c242 Merge pull request #4889 from shuujii/_0-is-not-numbered-parameter
`_0` is not numbered parameter
2019-12-21 22:10:42 +09:00
KOBAYASHI Shuji 74f564b0bb _0 is not numbered parameter
#### Before this patch:

  ```console
  $ bin/mruby rb -e '_0=:l; p ->{_0}.()'
  -e:1:13: _0 is not available
  -e:1:13: syntax error, unexpected $end, expecting '}'
  ```

#### After this patch (same as Ruby):

  ```console
  $ bin/mruby rb -e '_0=:l; p ->{_0}.()'
  :l
  ```
2019-12-21 18:54:15 +09:00
dearblue acef52c35e Perform shellquote on referenced string 2019-12-21 17:25:22 +09:00
Yukihiro "Matz" Matsumoto 5cc595cb2a Fix SEGV from numbered parameters outside of blocks; fix #4862 2019-12-21 01:24:56 +09:00
Yukihiro "Matz" Matsumoto ef8621cb61 Merge pull request #4885 from shuujii/fix-potentially-crash-in-%n-of-mrb_vformat-with-64-bit-int
Fix potentially crash in `%n` of `mrb_vformat()` with 64-bit `int`
2019-12-21 01:18:09 +09:00
KOBAYASHI Shuji e8299a89da Fix potentially crash in %n of mrb_vformat() with 64-bit int
If `mrb_sym` is smaller than `int`, it is promoted to `int`.
2019-12-20 23:04:46 +09:00
Yukihiro "Matz" Matsumoto 19fa77ddbb Merge pull request #4871 from dearblue/method-in-method
Avoid method in method
2019-12-20 19:29:48 +09:00
Yukihiro "Matz" Matsumoto adf358363c Merge pull request #4870 from dearblue/unnessesary-branch
Remove unnessesary branches
2019-12-20 19:24:45 +09:00
Yukihiro "Matz" Matsumoto 64e9f278b3 Merge pull request #4874 from dearblue/method-list
Fix for `#methods` to include methods that were `undef`
2019-12-20 19:23:13 +09:00
take-cheeze 9cde967321 Enable sanitizer in travis test 2019-12-19 14:21:49 +09:00
Yukihiro "Matz" Matsumoto 87809742f5 Fix mixed declarations in 429f6de 2019-12-19 10:00:33 +09:00
Yukihiro "Matz" Matsumoto fcde80a4d0 Merge pull request #4881 from shuujii/fix-mruby-bin-debugger-tests
Fix `mruby-bin-debugger` tests; ref d2f2f9db
2019-12-19 09:51:31 +09:00
Yukihiro "Matz" Matsumoto 868ba8464e Merge pull request #4882 from shuujii/simplify-print_backtrace
Simplify `print_backtrace()`
2019-12-19 09:50:22 +09:00
Yukihiro "Matz" Matsumoto 429f6defdd Reimplement vformat tests; close #4868
Avoid creating `Data` object that refers `mruby` objects.
Also close #4622 ref #4613
2019-12-19 09:35:51 +09:00
Yukihiro "Matz" Matsumoto 7f0e1fc90b Revert "%C value need not to be saved in TestVFormat::Native; close #4868"
This reverts commit f507ff4842.
It makes AppVeyor tests fail.
2019-12-19 00:07:08 +09:00
KOBAYASHI Shuji 6df6bd4ac7 Simplify print_backtrace() 2019-12-18 19:35:24 +09:00
KOBAYASHI Shuji f0b8c9ec06 Fix mruby-bin-debugger tests; ref d2f2f9db 2019-12-18 19:34:11 +09:00
Yukihiro "Matz" Matsumoto 815e0c400a Merge pull request #4875 from shuujii/remove-location-info-from-Exception-inspect
Remove location info from `Exception#inspect`
2019-12-18 01:55:23 +09:00
Yukihiro "Matz" Matsumoto 4c1667a5f6 Merge pull request #4879 from shuujii/refine-output-of-mrb_print_error
Refine output of `mrb_print_error()`
2019-12-18 01:54:28 +09:00