Clayton Smith
868d2e528f
Fix crash when exponent is -2147483648
2016-12-15 09:36:22 -05:00
Clayton Smith
73ad7395c0
Check type before calling mrb_range_ptr.
2016-12-13 10:04:15 -05:00
Yukihiro "Matz" Matsumoto
df35076602
Restore callinfo offset in mrb_yield_with_class()
2016-12-13 17:17:47 +09:00
Yukihiro "Matz" Matsumoto
3bedd22d55
Add assertion to make sure new capacity does not overflow.
2016-12-13 10:50:04 +09:00
Yukihiro "Matz" Matsumoto
3a7c369536
Make sure str->capa is under MRB_INT_MAX; fix #3342
2016-12-13 10:48:36 +09:00
Yukihiro "Matz" Matsumoto
9cef265402
should not try to set classpath for frozen classes; ref #3340
2016-12-12 10:34:21 +09:00
Yukihiro "Matz" Matsumoto
1164463a7c
freeze classes/modules; ref #3340
2016-12-12 01:05:07 +09:00
Yukihiro "Matz" Matsumoto
761562b65f
freeze instance variables; ref #3340
2016-12-12 01:00:24 +09:00
Yukihiro "Matz" Matsumoto
92c843dd07
rename prefix RBASIC_ to MRB_; ref #3340
2016-12-12 00:54:36 +09:00
Takashi Kokubun
10bb7ad693
Implement Object#freeze
2016-12-11 03:44:15 +09:00
Yukihiro "Matz" Matsumoto
3cc913490b
Merge pull request #3329 from bouk/reuse
...
Mark all the built-in classes during GC sweep
2016-12-10 16:02:47 +09:00
Yukihiro "Matz" Matsumoto
0af170fbec
gc.c: dead_slot is boolean; ref #3339
2016-12-10 15:34:32 +09:00
Kazuho Oku
2ef634edb5
do not destroy a page with an active TT_ENV (e.g. an env referred from TT_FIBER)
2016-12-10 15:11:07 +09:00
Felix Jones
2827655b9c
Removed unnecessary const macro - const keyword is already a dependency
2016-12-08 12:38:00 +00:00
Yasuhiro Matsumoto
c27dbfedf4
disable define const on VS
2016-12-08 15:56:50 +09:00
Yasuhiro Matsumoto
eda6c1dc05
fix build on vs2013-vs2015
2016-12-08 15:38:19 +09:00
Kazuho Oku
c2e749f878
fix issues of mrb_gc_unregister introduced in 09b1185
...
* fixes partial copy of objects in GC root array (due to missing `* sizeof(mrb_value)`)
* restores the behavior that permitted an unregistered object to be used as an argument
2016-12-08 10:27:07 +09:00
Bouke van der Bijl
f7a891fa89
Mark all the built-in classes during GC sweep
...
Reported by https://hackerone.com/haquaman
2016-12-07 15:14:12 -05:00
Yukihiro "Matz" Matsumoto
5930a6ebc7
Merge pull request #3328 from shugo/hash-dup-default_proc
...
Copy default_proc by Hash#dup.
2016-12-08 01:04:25 +09:00
Felix Jones
fe86cf4c91
Removed the errno declaration from string.c
2016-12-07 14:17:09 +00:00
Shugo Maeda
338e0ff52d
Copy default_proc by Hash#dup.
2016-12-07 22:39:20 +09:00
Felix Jones
6187c21bd9
Wrapped string.c errno with ifndef macro for platforms that use inbuilt errno macro
2016-12-07 12:46:47 +00:00
Yukihiro "Matz" Matsumoto
dffb4d82dc
Add type check for cls before allocation
2016-12-06 11:40:49 +09:00
Yukihiro "Matz" Matsumoto
6ec14a2173
Merge pull request #3318 from bouk/splat-stack
...
Fix stack move segfaulting in OP_ARYCAT
2016-12-05 16:51:46 +09:00
Yukihiro "Matz" Matsumoto
ac561a52f5
Add symbol type check for Module#undef_method
2016-12-04 10:41:01 +09:00
Yukihiro "Matz" Matsumoto
5c651d6ce9
add MRB_API to mrb_float_read(); ref #3270
2016-12-03 18:55:52 +09:00
Yukihiro "Matz" Matsumoto
a0fbc46ccd
Import locale insensitive strtod() from Ruby1.8; fix #3270
...
The function was renamed to `mrb_float_read(const char*, char**)`.
2016-12-03 18:47:04 +09:00
Yukihiro "Matz" Matsumoto
8f510be211
Merge branch 'method-missing-segfault' of https://github.com/bouk/mruby into bouk-method-missing-segfault
2016-12-03 18:20:29 +09:00
Yukihiro "Matz" Matsumoto
79a621dd73
Check before retrieving struct RRange pointer; fix #3320
...
range->edges may be NULL for example when #initialize_copy removed.
2016-12-03 12:30:01 +09:00
Yukihiro "Matz" Matsumoto
9776150263
Merge pull request #3317 from bouk/missing-to-s
...
Use mrb_ptr instead of mrb_cptr in Kernel#to_s
2016-12-03 12:01:43 +09:00
Yukihiro "Matz" Matsumoto
e673fbb35a
Merge pull request #3321 from clayton-shopify/fix-proc-crash-upstream
...
Fix segfault in mrb_proc_copy.
2016-12-03 11:54:22 +09:00
Clayton Smith
1ff4b3f800
Fix segfault in mrb_proc_copy.
2016-12-02 09:36:26 -05:00
Bouke van der Bijl
9c61e1cd87
Use mrb_ptr instead of mrb_cptr in Kernel#to_s
...
This is to avoid segfault when WORD_BOXING is enabled
Reported by https://hackerone.com/brakhane
2016-12-01 15:23:56 -05:00
Bouke van der Bijl
7d07466b43
Fix stack move segfaulting in OP_ARYCAT
...
Reported by https://hackerone.com/haquaman
Testcase (couldn't get it to work as a test):
def nil.b
b *nil
end
nil.b
2016-12-01 15:23:31 -05:00
Clayton Smith
2bc3a5fb78
Fix more integer overflows.
2016-12-01 09:08:38 -05:00
Yukihiro "Matz" Matsumoto
ab4ab7c8a0
Fix compile error by #3309
2016-12-01 18:37:03 +09:00
Clayton Smith
acdddb4f14
Prevent array size calculation overflows.
2016-11-30 13:55:09 -05:00
Yukihiro "Matz" Matsumoto
2bb47addad
Prohibit instantiation of immediate objects
2016-11-30 10:36:17 +09:00
Yukihiro "Matz" Matsumoto
f7c0024b8e
Merge pull request #3278 from bouk/dup-class
...
Copy over INSTANCE_TT when duping class
2016-11-30 03:52:56 +09:00
Yukihiro "Matz" Matsumoto
630733f346
check ttype before object allocation; fix #3294
2016-11-30 03:38:55 +09:00
Clayton Smith
b633aa9ad4
Use size_t to calculate bytes needed for array.
2016-11-29 10:26:02 -05:00
Yukihiro "Matz" Matsumoto
246a9a8acd
ary_concat: support self concatenation; fix #3302
2016-11-29 22:36:11 +09:00
Yukihiro "Matz" Matsumoto
9fc62d28d0
pre-allocate arena overflow error
2016-11-28 09:52:57 +09:00
Yukihiro "Matz" Matsumoto
36fc1f1431
Added Exception check in mrb_exc_set(); close #3292
...
PR #3293 just checks for NoMethodError.
2016-11-27 22:17:51 +09:00
Yukihiro "Matz" Matsumoto
d77b254108
Merge pull request #3287 from bouk/proc-arity
...
Fix calling .arity on Proc with undefined `initialize`
2016-11-25 09:20:47 +09:00
Yukihiro "Matz" Matsumoto
6905597f5b
Merge pull request #3284 from bouk/remove-method-segfault
...
Fix segfault on remove_method with invalid argument
2016-11-25 09:19:22 +09:00
Yukihiro "Matz" Matsumoto
a28fa35ea9
Merge pull request #3282 from bouk/fix-break-instance-class
...
Fix segfault when defining class inside instance_exec on primitive
2016-11-25 09:17:59 +09:00
Francois Chagnon
a384bcce35
Fix instances where return value of mrb_method_search_vm is unchecked
...
Reported by @charliesome
2016-11-24 10:51:29 -05:00
Clayton Smith
76a1bdfa29
Get String length after args in String#chomp!
...
Fixes RCE issue
Reported by @bouk
2016-11-24 10:28:21 -05:00
Francois Chagnon
1ec5994377
Fix calling .arity on Proc with undefined initialize
...
Reported by @bouk
2016-11-24 10:23:31 -05:00