Commit Graph

7786 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 8efa7b00df Preallocate SystemStackError; ref #3421 2017-02-15 11:59:47 +09:00
Yukihiro "Matz" Matsumoto 0376d4d4c6 Merge pull request #3455 from crimsonwoods/fix-android-build-script
Update android build script.
2017-02-15 10:30:27 +09:00
Yukihiro "Matz" Matsumoto dd24f9f5cc Avoid calling hook methods if they are not overridden. 2017-02-15 09:25:09 +09:00
Yukihiro "Matz" Matsumoto 04296925ac Use mrb_funcall_argv() instead of mrb_funcall() 2017-02-15 09:24:35 +09:00
crimsonwoods 5395dbfb3a Add new two build config files. 2017-02-15 09:01:55 +09:00
crimsonwoods a6b1e964a3 Modify default cflags. 2017-02-15 03:03:47 +09:00
crimsonwoods 838fa69aa3 Add '-Wl,--fix-cortex-a8' linker option for 'armeabi-v7a' architecture. 2017-02-15 00:51:10 +09:00
crimsonwoods 83a3da4456 Set default linker 'flags' and 'flags_before_libraries'. 2017-02-15 00:36:02 +09:00
Yukihiro "Matz" Matsumoto ba812d25ad Merge pull request #3453 from palkan/fix/test-gems-setup
Separate compilers setup from config setup
2017-02-14 09:09:34 +09:00
palkan 131566753d Separate compilers setup from config setup
Fixes #3418.
2017-02-13 20:59:07 +03:00
Yukihiro "Matz" Matsumoto 30aa521854 Do not use mrb_funcall() if Hash#default is not overridden; ref #3421
This change reduces the recursion level, but does not solve the stack
overflow issue entirely.
2017-02-14 00:22:12 +09:00
Yukihiro "Matz" Matsumoto 719f700adf Extend mruby stack when keep is bigger than room; fix #3421
But #3421 still cause stack overflow error due to infinite recursion.
To prevent overflow, we need to add different stack depth check.
2017-02-14 00:15:58 +09:00
Yukihiro "Matz" Matsumoto ecb6ac8b4a Fixed codegen error of redo in rescue; fix #3422
The issue (and the fix) was reported by https://hackerone.com/dgaletic
2017-02-13 19:31:06 +09:00
Yukihiro "Matz" Matsumoto c2ddcd4517 Should handle break from funcall(); fix #3434
This issue was reported by https://hackerone.com/d4nny
2017-02-13 18:45:20 +09:00
Yukihiro "Matz" Matsumoto f198530444 Fixed too much value_copy() when block is not given; fix #3440
The issue was reported by https://hackerone.com/titanous
2017-02-13 18:18:09 +09:00
Yukihiro "Matz" Matsumoto b23874777d Merge pull request #3452 from dabroz/fix-kernel-caller-aspec
Fixed aspec for Kernel#caller
2017-02-12 20:46:10 +09:00
Tomasz Dabrowski e4fa59f5ed Fixed aspec for Kernel#caller 2017-02-12 11:15:40 +01:00
Yukihiro "Matz" Matsumoto 60664823ba Merge pull request #3451 from dabroz/revert-string-mul
Revert "Optimization for String#* for 1-byte strings"
2017-02-11 22:49:20 +09:00
Yukihiro "Matz" Matsumoto 1f2d786e32 Avoid direct return from ecall(); fix #3441
There's incompatibility left for mruby.

When you return from `ensure` clause, mruby simply ignores the return
value.  CRuby returns from the method squashing the exception raised.

```
def f
  no_such_method() # NoMethodError
ensure
  return 22
end

p f() # CRuby prints `22`
```
2017-02-11 21:58:47 +09:00
Tomasz Dabrowski 90f262f642 Revert "Optimization for String#* for 1-byte strings"
This reverts commit d1bc7caeca.
2017-02-11 13:02:48 +01:00
Yukihiro "Matz" Matsumoto ff03a9a61c Avoid integer overflow in sprintf(); fix #3439
This issue was reported by https://hackerone.com/aerodudrizzt
2017-02-11 20:35:52 +09:00
Yukihiro "Matz" Matsumoto 642ab8ecda ecall() should preserve stack address referenced from ci[1].
OP_RETURN accesses ci[1]->stackent that might be broken; fix #3442
2017-02-11 18:13:39 +09:00
Yukihiro "Matz" Matsumoto 0b143898c4 Remove historical comment; ref #3450 #3448 2017-02-11 16:52:45 +09:00
Yukihiro "Matz" Matsumoto 0ef51d83c2 Merge pull request #3450 from r-obert/patch-1
remove skip that shouldn't be necessary anymore.
2017-02-11 16:50:06 +09:00
robert b130f43298 remove skip that shouldn't be necessary anymore.
the test should pass after https://github.com/mruby/mruby/commit/8f4a929e1a01c8d6176fb53a9ef5dff6de632959.
2017-02-11 07:40:55 +00:00
Yukihiro "Matz" Matsumoto 8f4a929e1a String#replace should update s->flags for MRB_STR_NO_UTF.
Otherwise String#size may return wrong length; fix #3448
2017-02-11 16:27:07 +09:00
Yukihiro "Matz" Matsumoto 6cb7aef563 Add type cast to pacify warning 2017-02-11 16:00:26 +09:00
Yukihiro "Matz" Matsumoto b36495bcb5 Merge pull request #3449 from dabroz/fix-ljust-ruby
String#ljust and String#rjust reimplemented with optimized Ruby
2017-02-11 10:26:09 +09:00
Tomasz Dabrowski d1bc7caeca Optimization for String#* for 1-byte strings 2017-02-10 15:31:33 +01:00
Tomasz Dabrowski ac9d04f4af String#ljust and String#rjust reimplemented with optimized Ruby 2017-02-10 15:31:33 +01:00
Tomasz Dabrowski 24048cd998 Tests for UTF-8 String#ljust and String#rjust 2017-02-10 15:16:49 +01:00
Yukihiro "Matz" Matsumoto c802cd07ba Merge pull request #3446 from ksss/minirake
Fix build error when trace mode
2017-02-10 21:22:00 +09:00
Yukihiro "Matz" Matsumoto 0dc26f52a0 Merge pull request #3447 from dabroz/fix-ljust
String#ljust and String#rjust reimplementation (fix #3445)
2017-02-10 21:20:26 +09:00
Tomasz Dabrowski 981105b3e6 String#ljust and String#rjust reimplementation (fix #3445)
- String#ljust and String#rjust are now C functions to improve performance
 - infinite loop because of an empty padding argument is now prevented (ArgumentError is raised)
 - extra tests for ljust/rjust added
2017-02-10 12:59:28 +01:00
ksss cd8284fe0b Fix build error when trace mode
Rakefile

```
file "a.txt" do
  system "echo hello > a.txt"
end

file "b.txt" => "a.txt" do
  system "cp a.txt b.txt"
end

task :default => "b.txt"
```

```
$ touch b.txt
$ ruby minirake --trace
Invoke default (already=[], needed=[true])
rake aborted!
No such file or directory @ rb_file_s_stat - a.txt
minirake:241:in `stat'
minirake:241:in `timestamp'
minirake:233:in `block in needed?'
minirake:233:in `collect'
minirake:233:in `needed?'
minirake:91:in `invoke'
minirake:95:in `block in invoke'
minirake:95:in `each'
minirake:95:in `invoke'
minirake:467:in `block in run'
minirake:466:in `each'
minirake:466:in `run'
minirake:484:in `<main>'
```
2017-02-10 13:15:49 +09:00
Yukihiro "Matz" Matsumoto d0ecf862d9 Fixed mixture of signed/unsigned integers
in mrbgems/mruby-bin-debugger.
2017-02-08 23:27:17 +09:00
Yukihiro "Matz" Matsumoto 4b32e651a5 Check if irep is NULL before print_backtrace()
According to the valgrind log attached to #3438, proc->body.irep
may be NULL in some cases.
2017-02-08 23:10:25 +09:00
Yukihiro "Matz" Matsumoto af4d74fc7d Add MRB_TT_PROC check to OP_SUPER as well; fix #3432 2017-02-08 21:13:22 +09:00
Yukihiro "Matz" Matsumoto 76135e757f Check if m->env is NULL before dereferencing it; fix #3436 2017-02-08 19:01:09 +09:00
Yukihiro "Matz" Matsumoto b277c58e78 Mark classes referenced from saved backtrace.
Maybe related to #3438
2017-02-08 16:31:37 +09:00
Yukihiro "Matz" Matsumoto f3d4ff16d3 Fixed a bug in ci address shifting; fix #3423
Dinko Galetic and Denis Kasak reported the issue and the fix.
(via https://hackerone.com/dgaletic).
2017-02-08 16:22:48 +09:00
Yukihiro "Matz" Matsumoto be550f04e4 codedump.c: OP_POPERR does not have register access. 2017-02-08 09:45:55 +09:00
Yukihiro "Matz" Matsumoto 7eebbce42f Merge pull request #3437 from eboda/master
Fix interpolation escaping in String.inspect
2017-02-08 08:58:41 +09:00
Edgar Boda-Majer 46e4e342f4 Fix interpolation escaping in String.inspect 2017-02-07 13:33:53 +01:00
Yukihiro "Matz" Matsumoto 794de3317a Merge pull request #3430 from ksss/local_variables
Kernel#local_variables: Make result array unique
2017-02-06 15:58:53 +09:00
ksss bd72dba8c0 Kernel#local_variables: Make result array unique 2017-02-06 11:16:47 +09:00
Yukihiro "Matz" Matsumoto f2b18a604c Check maximum number of formal arguments.
http://hkdnet.hatenablog.com/entry/2017/02/06/080000 (Japanese)
2017-02-06 09:14:49 +09:00
Yukihiro "Matz" Matsumoto 48e0bbbfee Make eval to use trampoline technique; fix #3415
Now `eval()` can call Fiber.yield etc.
2017-02-04 16:19:31 +09:00
Yukihiro "Matz" Matsumoto bf4e79cc62 argv may be modified when mrb_funcall() is called; fix #3419
Calling `mrb_funcall()` and `mrb_yield()` (and their related
functions) are discouraged unless absolutely necessary, because
it can cause this kind of issues very easily.
2017-02-04 14:10:39 +09:00
Yukihiro "Matz" Matsumoto 8f52b88ee7 No need to make env unshared in the finalization; fix #3425 2017-02-04 13:48:23 +09:00