Commit Graph

2177 Commits

Author SHA1 Message Date
cubicdaiya 8336072e86 fix SEGV bug for mrb_str_new_static
mrb_str_new_static causes seg-fault when 3rd argument is negative.
2014-02-28 02:07:09 +09:00
Yukihiro "Matz" Matsumoto 25822f2430 Merge pull request #1762 from cubicdaiya/issues/mrb_str_new_bug
fix SEGV bug for mrb_str_new
2014-02-28 01:44:09 +09:00
cubicdaiya 30fe3f5d4b fix SEGV bug for mrb_str_new
mrb_str_new causes seg-fault when 3rd argument is negative.
2014-02-28 01:30:09 +09:00
Yukihiro "Matz" Matsumoto 90c54d1ead remove break altogether in ci loop 2014-02-28 01:25:50 +09:00
Yukihiro "Matz" Matsumoto 9a9548eb0e Merge pull request #1760 from cubicdaiya/issues/make_mrb_str_dump_a_bit_faster
make mrb_str_dump a bit faster
2014-02-28 00:51:54 +09:00
Yukihiro "Matz" Matsumoto 30ac4e5596 Merge pull request #1758 from ksss/array-out-while
move check condition to outside in while block
2014-02-28 00:51:33 +09:00
cubicdaiya a238c9c1c3 make mrb_str_dump a bit faster 2014-02-28 00:20:36 +09:00
ksss 88f3e5b294 move check condition to outside in while block 2014-02-27 23:54:36 +09:00
cubicdaiya bd0244d067 use mrb_str_cat_lit() intead of mrb_str_cat 2014-02-27 22:42:25 +09:00
Yukihiro "Matz" Matsumoto d1526b0409 should not continue loop when ci = NULL 2014-02-27 19:00:37 +09:00
Yukihiro "Matz" Matsumoto b31a90614d boot_defclass: super may be NULL 2014-02-27 08:21:39 +09:00
Yukihiro "Matz" Matsumoto 5b8229715d revert 38e9ce21 and API changed; mrb_get_backtrace() -> renamed to mrb_exc_backtrace since this is a backtrace method implementation of Exception; mrb_get_backtrace_at() -> removed; mrb_get_backtrace() -> added to get backtrace in array (like caller) 2014-02-27 04:34:30 +09:00
Yukihiro "Matz" Matsumoto 0c1c4416e7 avoid recursion when method_missing happened in inspect; fix #1746 2014-02-27 04:23:57 +09:00
Yukihiro "Matz" Matsumoto d264e1addd fix indent 2014-02-27 03:50:59 +09:00
Yukihiro "Matz" Matsumoto 38e9ce21f8 add new function mrb_get_backtrace_at() to get backtrace at ci and pc 2014-02-27 03:45:52 +09:00
cubicdaiya 4c283714f6 use mrb_str_new_lit instead of mrb_str_new for C string literal 2014-02-26 22:34:12 +09:00
Yukihiro "Matz" Matsumoto cc39213856 Merge pull request #1748 from cubicdaiya/issues/optim_get_valid_iv_sym
fix bug for get_valid_iv_sym
2014-02-26 21:59:01 +09:00
Yukihiro "Matz" Matsumoto 8c949eeef0 Merge pull request #1747 from cubicdaiya/issues/use_mrb_intern_lit
use mrb_intern_lit instead of mrb_intern_cstr for C string literals
2014-02-26 21:56:59 +09:00
cubicdaiya d316115748 fix bug for get_valid_iv_sym
When sub-string is used in the following way, it does not work well.

o = Object.new
o.instance_variable_set(:@a, 1)
o.instance_variable_defined?("@abc"[0,2]) #=> false (this should be true)
2014-02-26 17:26:40 +09:00
cubicdaiya 6db2e080f0 use mrb_intern_lit instead of mrb_intern_cstr for C string literals 2014-02-26 13:48:11 +09:00
cubicdaiya 94c5a5ee73 use mrb_str_new_lit instead of mrb_str_new for C string literals 2014-02-26 02:23:50 +09:00
Yukihiro "Matz" Matsumoto d747ea72c4 resolve conflict 2014-02-26 00:06:58 +09:00
Yukihiro "Matz" Matsumoto 05d3b9de54 clarify fallthrough in the switch statement 2014-02-25 10:48:10 +09:00
Yukihiro "Matz" Matsumoto ebd976be84 initialize sname before interning 2014-02-25 10:43:16 +09:00
Yukihiro "Matz" Matsumoto c636386953 avoid accessing uninitialized string; ref ac936fc 2014-02-25 00:47:02 +09:00
Yukihiro "Matz" Matsumoto ddf9504558 Merge pull request #1721 from take-cheeze/d_format_spec
add 'd' format specifier in mrb_get_args and mruby-random gem improvement
2014-02-25 00:22:27 +09:00
Yukihiro "Matz" Matsumoto 46ee883574 move declaration to the top of the block; ref #1727 2014-02-23 20:41:15 +09:00
Yukihiro "Matz" Matsumoto e202d4cd53 add src/error.h for compatibility reason 2014-02-22 23:38:59 +09:00
h2so5 b0e3b873f5 preserve significands in float-string conversion 2014-02-22 16:50:52 +09:00
Yukihiro "Matz" Matsumoto ac936fc211 powered num may be infinite in float-string conversion 2014-02-22 11:06:38 +09:00
take_cheeze 8060478b3c add 'd' format specifier to get data pointer directly from mrb_get_args 2014-02-21 17:29:49 +09:00
take_cheeze 08ea324593 move src/error.h to include/mruby/error.h 2014-02-20 22:41:29 +09:00
cremno 61577e8d6b mrb_flo_to_str: internal linkage 2014-02-18 04:37:35 +01:00
cremno 69bc004e08 iv_size (non-seglist): return 0 if t is NULL 2014-02-17 12:39:56 +01:00
cremno 1838099e00 more mrb_flo_to_str fixes
- remove float check (take mrb_float instead of mrb_value)
- support -0.0
- fix range error if log10 is called when n == 0.0
- MSVC older than 2013: add signbit macro (for double)
2014-02-17 12:37:39 +01:00
Yukihiro "Matz" Matsumoto 57b7f6b619 use double instead of mrb_float (that may be single precision float) to reduce errors 2014-02-17 10:20:58 +09:00
Yukihiro "Matz" Matsumoto eacdcc13d8 remove trailing zeros from float string representation 2014-02-17 10:11:51 +09:00
Yukihiro "Matz" Matsumoto a740b28b52 define FLO_EPSILON depends on float/double 2014-02-17 09:47:39 +09:00
Yukihiro "Matz" Matsumoto 4b981adc58 remove max_digit from mrb_flo_to_str() 2014-02-17 09:40:30 +09:00
Yukihiro "Matz" Matsumoto ffe541b503 small refactoring; direct return 2014-02-17 09:35:20 +09:00
Yukihiro "Matz" Matsumoto 25ea4d751b use powf() instead of pow() on MRB_USE_FLOAT 2014-02-17 09:34:56 +09:00
Yukihiro "Matz" Matsumoto b4bc395680 fdigit may be negative due to error if mrb_float is 32bit (e.g. 10**36 on 32bit arch); ref #1713 #1714 2014-02-17 09:27:53 +09:00
h2so5 db80a9a2ce fix mrb_flo_to_str() exponent problem 2014-02-17 07:53:02 +09:00
Yukihiro "Matz" Matsumoto 41a77111ea Merge pull request #1710 from takkaw/flo_to_str
modify mrb_to_str() in order to display big float number
2014-02-16 01:33:43 +09:00
Yukihiro "Matz" Matsumoto e29efb02bd normalize NaN after division that may generate NaN; fix #1712 2014-02-15 19:59:26 +09:00
takkaw 0a48fb0407 modify mrb_to_str() in order to display big float number 2014-02-15 15:40:51 +09:00
Li Yazhou adbf1eba99 clearn up warning in hash.c
/home/fleuria/code/mruby/src/hash.c:159:1: warning: ‘mrb_hash_dp`defined but not used [-Wunused-function]
 mrb_hash_dup(mrb_state *mrb, mrb_value hash)
     ^

this commit defines Hash#dup to take advantage of mrb_hash_dup, however
it seems that Hash#dup is not in ISO standard.
2014-02-14 13:22:30 +08:00
Yukihiro "Matz" Matsumoto ba8a8e75c7 Merge pull request #1702 from cremno/hash-hash-ext-changes
hash / hash-ext: various small changes
2014-02-14 01:29:19 +09:00
cremno 8bbc2c107b mrb_str_cat2: deprecated since 0cedf8f 2014-02-13 13:45:28 +01:00
cremno 4ffea85b62 hash / hash-ext: various small changes
src/hash.c:
 - mrb_hash_(aget|aset|dup|delete): internal linkage
 - remove documentation of methods which are not implemented (in here)
 - remove #assoc; unused, not in ISO spec
 - remove #rassoc: same, implementation is also wrong

hash-ext mrbgem:
 - remove header "mruby/khash.h"
 - remove mrb_hash_values_at (move code into hash_values_at, i: long -> int)
 - less whitespace in gem_init function
2014-02-13 13:39:09 +01:00