Commit Graph

7738 Commits

Author SHA1 Message Date
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
Yukihiro "Matz" Matsumoto 8e0f231330 Mark mrb->backtrace.exc as GC root; fix #3388 2017-02-04 12:59:08 +09:00
Yukihiro "Matz" Matsumoto 6e0ba0085d Jump address should fit in 16 bits range; fix #3426 2017-02-04 12:37:08 +09:00
Yukihiro "Matz" Matsumoto a746ebe96f Merge pull request #3420 from udzura/patch-1
Fix usage of Class#name in mruby-bin-mruby's bintest
2017-02-03 09:30:22 +09:00
Yukihiro "Matz" Matsumoto e0323dff8c Merge pull request #3427 from clayton-shopify/fix-mrb-random-init
Fetch arguments earlier in mrb_random_init to avoid a crash.
2017-02-03 09:29:46 +09:00
Clayton Smith a8ccda5692 Fetch arguments earlier to avoid a crash. 2017-02-02 16:35:59 -05:00
Uchio KONDO ab5812d0d8 Use standard Module(Class)#to_s 2017-02-02 18:09:27 +09:00
Yukihiro "Matz" Matsumoto 6420951463 Update example lines of mrbgems in build_config.rb; ref #3414 2017-01-25 15:38:25 +09:00
Yukihiro "Matz" Matsumoto ac88f85a9e Copy mrb_float values from pool when MRB_WORD_BOXING; ref #3396 2017-01-25 11:09:15 +09:00
Yukihiro "Matz" Matsumoto 51d7a69ab0 Clear (o).w first for MRB_WORD_BOXING; ref #3396 2017-01-25 11:07:57 +09:00
Yukihiro "Matz" Matsumoto b3ce364537 Outer class may be same as the class; fix #3382 2017-01-24 17:54:05 +09:00
Yukihiro "Matz" Matsumoto 72bff2932b Use size_t to avoid integer overflow in mrb_ary_splice(); fix #3413 2017-01-24 11:36:27 +09:00
Yukihiro "Matz" Matsumoto 28cf7a549d Change return type of mrb_range_beg_len() from int to mrb_int.
ref #3411
2017-01-23 22:18:29 +09:00
Yukihiro "Matz" Matsumoto f0f095bc13 Fix a double free problem in codegen.c; fix #3378
This issue was first reported by https://hackerone.com/geeknik
The fix was proposed by @titanous
2017-01-23 16:53:31 +09:00
Yukihiro "Matz" Matsumoto 3ce82603a5 Fix memory leak; ref #3378
The fix was proposed by @titanous
2017-01-23 16:48:18 +09:00
Yukihiro "Matz" Matsumoto ffb5e5ab08 The ensure clause should keep its ci after its execution; fix #3406
This issue was reported by https://hackerone.com/ston3
2017-01-23 16:44:11 +09:00
Yukihiro "Matz" Matsumoto 324887d0d6 Backtrace list must be an array of strings; fix #3408 2017-01-23 16:23:48 +09:00
Yukihiro "Matz" Matsumoto 28b7b9ec64 Skip non string values in backtraces; ref #3408 2017-01-23 16:22:55 +09:00
Yukihiro "Matz" Matsumoto 40ec03c8c2 Merge pull request #3412 from ksss/mrb_ary_splice
Refactoring: Use array_copy instead of for loop
2017-01-23 15:24:56 +09:00
ksss 78a395d446 Refactoring: Use array_copy instead of for loop 2017-01-23 15:18:48 +09:00
Yukihiro "Matz" Matsumoto 4d38cad31b Add MRB_API to mrb_range_beg_len(); ref #3411 2017-01-23 15:05:12 +09:00
Yukihiro "Matz" Matsumoto 5e1d923381 Changed the behavior of mrb_range_beg_len(); close #3411
The new API is:

int mrb_range_beg_len(mrb, range, &beg, &len, len, trunc)

The new argument `trunc` is a boolean value that specifies
whether the function truncates the range. The new return value
is an integer instead of a boolean, that is:

 0: not a range
 1: range with proper edges
 2: out of range

To get the old behavior, you have to rewrite:

  mrb_range_beg_len(mrb, range, &beg, &len, len)

to:

  mrn_range_beg_len(mrb, range, &beg, &len, len, TRUE) == 1

[Breaking Change]
2017-01-23 14:35:26 +09:00
Yukihiro "Matz" Matsumoto 708088c5fa Should not make empty strings shared; fix #3407 2017-01-23 10:52:40 +09:00
Yukihiro "Matz" Matsumoto 49fd7590df Use mrb_write_barrier() instead of mrb_field_write_barrier_value()
ref #3409
2017-01-23 10:32:33 +09:00
Yukihiro "Matz" Matsumoto fdec607cd0 Remove unnecessary inline declaration; ref #3409 2017-01-23 10:30:14 +09:00
Yukihiro "Matz" Matsumoto 9d0f07e6a7 Merge pull request #3409 from ksss/mrb_ary_splice
Rewrite mrb_ary_splice
2017-01-23 10:28:09 +09:00
Yukihiro "Matz" Matsumoto 39ce9fe585 Merge pull request #3410 from ksss/mrb_ary_aset
Should raise RuntimeError when object frozen
2017-01-23 00:24:00 +09:00
ksss b49bd70f59 Should raise RuntimeError when object frozen 2017-01-22 18:53:20 +09:00
ksss 65c9baae7c Rewrite mrb_ary_splice
Referenced to CRuby's array.c(rb_ary_splice)

fix #3405
2017-01-22 14:06:23 +09:00
Yukihiro "Matz" Matsumoto bd50273bbc Merge pull request #3404 from clayton-shopify/fix-block-params
Fix incorrect parsing of block parameters.
2017-01-21 23:52:26 +09:00
Clayton Smith 797ff625f3 Fix incorrect parsing of block parameters. 2017-01-21 09:08:37 -05:00
Yukihiro "Matz" Matsumoto c48aef0b65 Stack position may be bigger than stack bottom; fix #3401
This issue was reported by https://hackerone.com/titanous
2017-01-21 18:01:12 +09:00
Yukihiro "Matz" Matsumoto 873b96bebc Merge pull request #3402 from clayton-shopify/fix-masgn-optimization
Remove problematic optimization from NODE_MASGN codegen
2017-01-21 11:15:14 +09:00
Clayton Smith 2c0f8f1a23 Remove problematic optimization. 2017-01-20 18:40:18 -05:00
Yukihiro "Matz" Matsumoto b23fb45f9c Integral#step without arg should loop forever as CRuby does. 2017-01-20 17:58:29 +09:00
Yukihiro "Matz" Matsumoto fe0e45505b Initialize callinfo->acc; ref #3243 2017-01-18 17:53:08 +09:00
Yukihiro "Matz" Matsumoto c8536d977d Merge pull request #3362 from ksss/proc
Proc shouldn't have `initialize` method
2017-01-18 00:09:26 +09:00
Yukihiro "Matz" Matsumoto c83069860a Dots is not needed for base 10 negative numbers; fix #3400 2017-01-16 17:21:55 +09:00
Yukihiro "Matz" Matsumoto c59ef59ad9 Merge pull request #3399 from ksss/caller
Implement Kernel.#caller
2017-01-16 17:11:47 +09:00
ksss 59d9f313df Skip when backtrace doesn't get 2017-01-14 22:01:20 +09:00
ksss 6f9cb7406a Implement Kernel.#caller 2017-01-14 22:01:20 +09:00
Yukihiro "Matz" Matsumoto 8d61f2120c Add proper given argument number in the wrong-number-argument error. 2017-01-12 23:14:35 +09:00
Yukihiro "Matz" Matsumoto a3571240e5 Add proper stack size calculation; fix #3398
This issue was reported by https://hackerone.com/ssarong
2017-01-12 23:08:58 +09:00
Yukihiro "Matz" Matsumoto 38acb9ec36 Kernel#initialize should not break existing mt; fix #3397
This issue was reported by https://hackerone.com/icanthack
The solution is suggested by @clayton-shopify.
2017-01-12 21:43:23 +09:00
Yukihiro "Matz" Matsumoto 41eff635bf Merge pull request #3393 from clayton-shopify/fix-exc-initialize
Fix broken MRB_INT64
2017-01-12 15:31:32 +09:00
Yukihiro "Matz" Matsumoto fb1dad82aa Merge pull request #3394 from clayton-shopify/really-fix-nme
Fix 36fc1f14 not checking in the right location
2017-01-12 15:29:02 +09:00
Yukihiro "Matz" Matsumoto a69d92e819 Merge pull request #3395 from hhc0null/fix-typo
Fix a typo in string.h.
2017-01-12 15:04:13 +09:00
hhc0null af4f6e8dc6 Fix a typo. 2017-01-12 00:02:17 +09:00
Bouke van der Bijl 6be5160eb6 Fix 36fc1f14 not checking in the right location 2017-01-11 09:10:12 -05:00