Commit Graph

2263 Commits

Author SHA1 Message Date
Keita Obo 3faa76851d Prevent accepting String value for mrb_get_args("i")
Accepting String value for mrb_get_args("i")
causes unintentional expression.

  * `"str" * "3"` => `"strstrstr"`

This change prevents String->Integer conversion for mrb_get_args("i")
and fixes above problem.

See also:
https://github.com/mruby/mruby/issues/1903
2014-03-21 21:41:04 +09:00
Yukihiro "Matz" Matsumoto 2c44f96e78 reduce hash creation by using update method 2014-03-21 09:31:44 +09:00
Yukihiro "Matz" Matsumoto 45b0e1f788 should be able to create hash with 127+ entries; close #1894 2014-03-21 09:18:10 +09:00
Yukihiro "Matz" Matsumoto 36836c8eb9 should restore proc after rescue; close #1891 2014-03-20 16:10:12 +09:00
Yukihiro "Matz" Matsumoto 72c274473b remove size_t cast in mrb_assert() since ((size_t)n <= SIZE_MAX) is always true 2014-03-19 09:07:59 +09:00
Yukihiro "Matz" Matsumoto 9084e03556 rename mrb_yield_internal to mrb_yield_with_class since it's no longer internal 2014-03-19 08:57:54 +09:00
Tomoyuki Sahara 93694fe521 export mrb_yield_internal. 2014-03-19 01:08:01 +09:00
Yukihiro "Matz" Matsumoto 792c1add0c string functions arguments changed from mrb_int to size_t that would take strlen() 2014-03-19 00:46:27 +09:00
Yukihiro "Matz" Matsumoto 180b3d5678 change mrb_int to size_t that would take strlen() 2014-03-19 00:17:03 +09:00
Yukihiro "Matz" Matsumoto 3e24e06b29 add a space after C reserved words 2014-03-18 23:57:29 +09:00
Yukihiro "Matz" Matsumoto 4893a1f431 Merge pull request #1884 from monaka/pr-reduce-implicit-type-cast
Reduce implicit type casts.
2014-03-18 22:18:57 +09:00
Masaki Muranaka 1df355e300 Reduce implicit type casts. 2014-03-18 17:36:47 +09:00
Yukihiro "Matz" Matsumoto 9201af7d36 mark root fiber object; close #1865 2014-03-18 12:39:11 +09:00
Yukihiro "Matz" Matsumoto d53423fb7d Merge pull request #1870 from ksss/convert_type
fix bool number to macro
2014-03-17 00:15:01 +09:00
Yukihiro "Matz" Matsumoto e4ae3bf661 Merge pull request #1871 from ksss/numeric-plus
fix bug when `0 + other object`
2014-03-17 00:14:42 +09:00
Yukihiro "Matz" Matsumoto 5140e27b5a Merge pull request #1872 from ksss/numeric-mul
fix bug when `0 * other object`
2014-03-17 00:14:16 +09:00
ksss 0fab9d557e float + nil should be raise TypeError 2014-03-16 23:39:58 +09:00
ksss 9dcce29749 fix bug when 0 * other object 2014-03-16 23:08:31 +09:00
ksss e9f3dca0f4 fix bug when 0 + other object 2014-03-16 22:52:25 +09:00
ksss a481976056 fix bool number to macro 2014-03-16 21:06:08 +09:00
cubicdaiya cee152670a unify indent style 2014-03-16 07:44:44 +09:00
Yukihiro "Matz" Matsumoto 62505d51cc calc hash value directly for strings, symbols and numbers 2014-03-15 15:53:12 +09:00
Yukihiro "Matz" Matsumoto 048bca43c9 string length type to be mrb_int 2014-03-15 15:47:21 +09:00
Yukihiro "Matz" Matsumoto c476c1b528 symbol length type to be mrb_int 2014-03-15 15:43:40 +09:00
Yukihiro "Matz" Matsumoto 2bd099c842 remove new_label(s) where label position can be obtained from genop() 2014-03-14 03:11:11 +09:00
Yukihiro "Matz" Matsumoto 91f2d47d34 too much optimization 2014-03-13 23:44:10 +09:00
Yukihiro "Matz" Matsumoto 8cc487c465 peephole optimization for OP_JMP{IF,NOT} 2014-03-13 19:54:50 +09:00
Yukihiro "Matz" Matsumoto 5b3c76ee48 Merge pull request #1849 from cremno/add-mrb_int_bit-macro
add MRB_INT_BIT
2014-03-13 03:09:58 +09:00
Yukihiro "Matz" Matsumoto ad04b45e5b Merge pull request #1851 from tmash06/add_include_limit_h
add including limits.h.
2014-03-13 03:09:03 +09:00
tmash06 cfcd2e2dc9 add including limits.h.
Because Android's libc(bionic) defines SIZE_MAX at limits.h.
2014-03-13 02:37:09 +09:00
Yukihiro "Matz" Matsumoto 7e8652d549 Merge pull request #1843 from take-cheeze/suppress_warnings
Suppress warnings.
2014-03-12 11:45:14 +09:00
take_cheeze 7c4961234d fix mrb_funcall calling 2014-03-12 10:18:38 +09:00
cremno 1b6a4fb5a2 add MRB_INT_BIT 2014-03-11 20:14:18 +01:00
take_cheeze 52cf39a67a remove deprecated register keyword 2014-03-11 22:01:00 +09:00
take_cheeze bbb7ba46b2 don't use of anonymous unions 2014-03-11 22:01:00 +09:00
ksss 58a5e832d9 fix sym_intern argument type 2014-03-11 09:12:56 +09:00
Yukihiro "Matz" Matsumoto 86a48b7c48 Merge pull request #1840 from ksss/bit-field
set bit field for mrb_bool
2014-03-10 22:24:36 +09:00
ksss a53dd33eaa set bool macro 2014-03-10 13:18:34 +00:00
ksss 49a048c544 set bit field for mrb_bool 2014-03-10 13:14:07 +00:00
cubicdaiya 042c9f95a5 add comments at end of include guard 2014-03-10 12:37:47 +09:00
Masaki Muranaka 40f57f7b42 Use mrb_str_new_cstr() instead of mrb_str_new() with strlen(). 2014-03-09 16:45:29 +09:00
Yukihiro "Matz" Matsumoto 4f27089b4a Merge branch 'master' of github.com:mruby/mruby 2014-03-09 03:16:28 +09:00
Yukihiro "Matz" Matsumoto bc663549ea Merge pull request #1833 from cremno/use-mrb_str_cat_lit
use mrb_str_cat_lit for literals
2014-03-09 03:01:54 +09:00
Yukihiro "Matz" Matsumoto 24839d74b2 Merge pull request #1834 from cremno/use-nan-and-infinity-macros
use NAN and INFINITY macros
2014-03-09 03:01:04 +09:00
cremno bfc522bcd5 use mrb_str_cat_lit for literals 2014-03-08 18:38:31 +01:00
Yukihiro "Matz" Matsumoto 6423011986 remove invocation of strlen() on buffer of strings; with refactoring 2014-03-09 02:35:49 +09:00
Yukihiro "Matz" Matsumoto ee57789c72 Merge pull request #1831 from monaka/pr-make-type-casts-safer
Make type casts safer
2014-03-09 01:28:31 +09:00
Yukihiro "Matz" Matsumoto 452bf73c23 Merge pull request #1832 from ksss/fix-1823
fix #1823
2014-03-09 01:27:34 +09:00
cremno f57b9d1576 use NAN and INFINITY
The macro str_to_mrb_float (strto[df]) converts a string to a number,
but these two macros can be used to directly get the special value.

The NAN macro requires quiet NaN support, but so does str_to_mrb_float.

This change also circumvents missing C99 support in Microsoft's C library.
Its (or ISO C90's) strtod doesn't parse "nan" or "inf".
2014-03-08 17:25:07 +01:00
Yukihiro "Matz" Matsumoto bd4b59cd04 add "?" specifier to check if preceding optional argument is given 2014-03-09 00:25:59 +09:00