Commit Graph

6671 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 4ebe94725c Merge pull request #2892 from Mav7/master
Added documentation for hash.
2015-07-18 16:19:27 +09:00
Ralph Desir(Mav7) 6619dc4d75 Deleted range and string markdowns for now. 2015-07-17 14:43:55 -04:00
Ralph Desir f282d94793 Update hash.h.md 2015-07-17 14:25:15 -04:00
Ralph Desir 78a40fce88 Update hash.h.md 2015-07-17 14:21:13 -04:00
Yukihiro "Matz" Matsumoto 34fc856a45 Merge pull request #2890 from jbreeden/sub_pattern_not_found
Don't crash if pattern not found for sub
2015-07-17 11:37:30 +09:00
Jared Breeden 08c12ab7bf Don't crash if pattern not found for sub 2015-07-16 15:33:07 -07:00
Yukihiro "Matz" Matsumoto 6c94b2d963 Merge pull request #2889 from takkaw/fix_build_cygwin64
64bit Cygwin also doesn't have frexpl(3)
2015-07-16 21:56:38 +09:00
Yukihiro "Matz" Matsumoto 4f37adfd5e Merge pull request #2887 from cremno/use-mrb_str_cat_str-instead-of-mrb_str_append
use mrb_str_cat_str() instead of mrb_str_append()
2015-07-16 21:56:00 +09:00
Yukihiro "Matz" Matsumoto 31d085e795 Merge pull request #2888 from cremno/delete-non-nullptr-checks-before-mrb_free()-calls
delete mrb_free()-related non-NULL checks
2015-07-16 21:55:27 +09:00
takkaw 67e187f0f8 64bit Cygwin also doesn't have frexpl(3) 2015-07-16 18:40:07 +09:00
cremno 0f284091d1 delete mrb_free()-related non-NULL checks
No need to optimize since a program only exits once and errors are rare.
Also the mruby source code doesn't have these kind of checks elsewhere.

The ones in {Time,Random}#initialize are kept because there it actually
matters
since initialization always happens and re-initialization is unlikely.
2015-07-16 04:58:21 +02:00
cremno 938ed044f4 use mrb_str_cat_str() instead of mrb_str_append()
If the argument is always a string, then mrb_str_cat_str() can be
directly called instead of indirectly by mrb_str_append().

mrb_any_to_s(), mrb_obj_as_string(), mrb_inspect() always return a
string.
2015-07-16 03:56:31 +02:00
Yukihiro "Matz" Matsumoto 207577f0af mrb_protect() to return the exception raised (with the state of true) 2015-07-15 14:47:15 +09:00
Yukihiro "Matz" Matsumoto 1085167fef add an small comment description in mruby/error.h header 2015-07-15 14:47:15 +09:00
Yukihiro "Matz" Matsumoto c0bf76d0a1 remove unused variable declaration 2015-07-15 14:47:15 +09:00
take_cheeze f6b5a82972 Use class array instead of variadic. 2015-07-15 14:47:15 +09:00
take_cheeze cdd72d9c37 Implement mrb_protect, mrb_ensure, mrb_rescue, mrb_rescue_exceptions.
(`mrb_rescue_exceptions` is mruby implementation of `rb_rescue2`.)
Closes #2844, closes #2837.
2015-07-15 14:46:56 +09:00
take_cheeze 2e4bc2de88 Refactor Build#compile_as_cxx. 2015-07-15 14:46:56 +09:00
Yukihiro "Matz" Matsumoto 69a2c5cc73 Merge pull request #2884 from jbreeden/doc_bang_modifier
Doc bang modifier
2015-07-14 15:32:47 +09:00
jbreeden e92da7b76c Fix typo 2015-07-13 23:26:29 -07:00
jbreeden 510e53d89f Add ! documentation to mruby.h.md 2015-07-13 23:21:19 -07:00
Yukihiro "Matz" Matsumoto 53a81da0fa mrb_get_args: improve function description about ! 2015-07-14 13:35:06 +09:00
Yukihiro "Matz" Matsumoto 4e7050fe0c mrb_get_args: allow d! 2015-07-14 13:34:21 +09:00
Yukihiro "Matz" Matsumoto a075498613 mrb_get_args: allow A,H,s,z,a,d specifiers to take ! to accept nil.
S,A,H gives nil, s,z,a,d gives NULL for nil argument. ref 02474da
2015-07-14 13:22:42 +09:00
Yukihiro "Matz" Matsumoto d0e67aada7 use "S!" specifier of mrb_get_args() to improve #2882 fix. 2015-07-13 11:18:44 +09:00
Yukihiro "Matz" Matsumoto 02474daa14 allow '!' after 'S' specifier of mrb_get_args() that allow nil.
thus "S!" means String|nil type. you have to check nil before
dereferencing the value.  this is added to address #2882 while
keeping code simplicity. besides that current #2882 fix lose
polymorphism provided by mrb_get_args().
2015-07-13 11:14:50 +09:00
Yukihiro "Matz" Matsumoto 9c311ddc93 refactor mrb_bob_missing to share raising NoMethodError code; fix #2878
Note: arguments of mrb_no_method_error() has changed. You need to replace
3rd and 4th argument (say n, argv) to mrb_ary_new_from_values(mrb, n, argv).
2015-07-13 11:07:59 +09:00
Yukihiro "Matz" Matsumoto 4dac03cb2d Merge pull request #2883 from jbreeden/array_join_nil
Patching array join
2015-07-12 22:42:18 +09:00
jbreeden dd558a108d Removing unndeeded to_s 2015-07-11 21:15:33 -07:00
jbreeden bdbd696c48 Patching array join 2015-07-11 21:03:04 -07:00
Yukihiro "Matz" Matsumoto 39dd182244 Merge pull request #2880 from mattn/llround
implement llround. some platform (ex: mingw32) doesn't have llround.
2015-07-09 14:57:29 +09:00
Yasuhiro Matsumoto 1167fd1ae4 use round for llround. some platform (ex: mingw32) doesn't have llround. 2015-07-09 11:02:34 +09:00
Ralph Desir 82380780db Update hash.h.md 2015-07-08 05:35:37 -04:00
Mav7 2523ed473a Added new markdowns. 2015-07-08 04:50:01 -04:00
Yukihiro "Matz" Matsumoto 40252169fc method_missing definition may be undefined; fix #2878 2015-07-07 10:32:54 +09:00
Yukihiro "Matz" Matsumoto 5cfc0d0dc0 Merge pull request #2877 from cremno/fix-dangling-ptr
Coverity: fix dangling pointer
2015-07-07 07:40:38 +09:00
Yukihiro "Matz" Matsumoto 5daabc9407 Merge pull request #2876 from joans321/master
fix androideabi cross-compile error : undefined reference to 'frexpl'
2015-07-07 00:36:51 +09:00
Yukihiro "Matz" Matsumoto f1c6d6c866 Merge pull request #2875 from davydovanton/doc-comment-typo
Fix typo in comment in String#mrb_cstr_to_inum
2015-07-07 00:34:03 +09:00
xuejianqing 0b50b4a500 fix androideabi cross-compile error : undefined reference to 'frexpl' 2015-07-06 12:51:57 +08:00
Anton Davydov 03ae38df4e Fix typo in comment in String#mrb_cstr_to_inum [skip ci] 2015-07-05 13:53:14 +03:00
Yukihiro "Matz" Matsumoto e690e1e877 Merge pull request #2871 from archSeer/patch-2
Fix incorrect memory allocation of mrdb_state_new.
2015-07-03 15:05:29 +09:00
Yukihiro "Matz" Matsumoto 1dbb2b74d3 Merge pull request #2874 from cremno/fix-parser-oob-write
Coverity: fix oob write by actually truncating buffer
2015-07-03 15:03:45 +09:00
Yukihiro "Matz" Matsumoto b071dcd4fb Merge pull request #2873 from cremno/fix-coverity-missing-break-in-switch
Coverity: fix missing break in switch defects
2015-07-03 15:03:01 +09:00
cremno 7206a8c4f9 fix dangling pointer
CID 75872 (#3-2 of 3): Pointer to local outside scope (RETURN_LOCAL)
38. use_invalid: Using p, which points to an out-of-scope variable buf.
2015-07-03 02:48:22 +02:00
cremno 24583a7a18 fix oob write by actually truncating buffer
Found by Coverity scan of polyfox-moon:
CID 121927 (#1 of 1): Out-of-bounds write (OVERRUN)
2015-07-03 01:30:54 +02:00
cremno 43df1d7e39 remove unnecessary default case 2015-07-03 01:14:06 +02:00
cremno 6a74b8bf0d add missing fall through comments 2015-07-02 22:11:21 +02:00
Blaž Hrastnik a4f63caa79 Fix incorrect memory allocation of mrdb_state_new.
As detected in a Coverity scan. https://scan8.coverity.com/reports.htm#v26153/p11375/fileInstanceId=6844472&defectInstanceId=2516000&mergedDefectId=75866
2015-07-02 20:47:22 +02:00
Yukihiro "Matz" Matsumoto ff49cf95fc Merge pull request #2869 from cremno/refactor-print.c
src/print.c: rewrite printstr() to get rid of code duplication
2015-07-01 08:47:41 +09:00
Yukihiro "Matz" Matsumoto 18c82d5359 Merge pull request #2868 from sgnr/avoid-narrowing-cast-in-flo-round
Avoid a narrowing cast in flo_round under MRB_INT64.
2015-07-01 08:43:49 +09:00