summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2020-04-29Avoid comparing pointers and integersdearblue
2020-04-29Makes `mrb_any_to_s()` accept an object whose class is `NULL`dearblue
When using `mrb_any_to_s()` for debugging purposes, giving an object whose class is `NULL` no longer causes a SIGSEGV and no crash. This is achieved by making `mrb_class_name()` and `mrb_str_cat_cstr()` null safe.
2020-04-29Sorting the list of gems at build time by namedearblue
Printing them in sorted order makes it easier to find the desired gem. But it has come to completely ignore the dependency.
2020-04-28Should not use `assert` with expressions with side-effect; ref #4981Yukihiro "Matz" Matsumoto
`assert()` can be completely removed when `NDEBUG` is set.
2020-04-28Fixed wrong condition in #4981.Yukihiro "Matz" Matsumoto
2020-04-28Add `#include <string.h>` on all platforms for `strncpy`; #4981Yukihiro "Matz" Matsumoto
2020-04-28Remove unused local variable if `MRB_UTF8_STRING` is not set.Yukihiro "Matz" Matsumoto
Ref #4982 #4983
2020-04-28Avoid `snprintf` in `mruby-io` test; ref #4981Yukihiro "Matz" Matsumoto
2020-04-28Remove the temporary file from the `AF_UNIX` socket test; #4981Yukihiro "Matz" Matsumoto
2020-04-28Fix `IO#readchar` to return broken UTF-8 rather than `EOF` error.Yukihiro "Matz" Matsumoto
The behavior is different from CRuby, but we believe this is a right behavior for mruby, which only supports either ASCII or UTF-8 exclusively; fix #4983, ref #4982 ``` $ printf '\xe3\x81' | ruby -e 'p STDIN.readchar' "\xE3\x81" ``` ``` $ printf '\xe3\x81' | mruby -e 'p STDIN.readchar' "\xE3" ```
2020-04-28Fix `IO#readchar` to support UTF-8 char reading; fix #4712Yukihiro "Matz" Matsumoto
This fix only effective when `MRB_UTF8_STRING` is set.
2020-04-28Rename (and expose) UTF-8 related functions; ref #4712Yukihiro "Matz" Matsumoto
- mrb_utf8len() - returns the size of a UTF-8 char (in bytes) - mrb_utf8_strlen() - returns the length of a UTF-8 string (in char)
2020-04-28Fix `_read_buf` to be more efficient; fix #4982Yukihiro "Matz" Matsumoto
The bug was introduced by #4712. The `getc' problem resurrected. It should be addressed soon.
2020-04-28Fix `IO#sysread` to update buffer string on `EOF`; ref #4982Yukihiro "Matz" Matsumoto
2020-04-28Update `IO#ungetc` to keep `@buf` string; ref #4982Yukihiro "Matz" Matsumoto
2020-04-28Fix UTF-8 boundary check; ref #4982Yukihiro "Matz" Matsumoto
2020-04-28Merge pull request #4981 from udzura/fix-test-mruby-io-on-vboxsfYukihiro "Matz" Matsumoto
Test mruby-io in tmpdir when AF_UNIX cannot be created on cwd
2020-04-28Fix typo and include locationUchio Kondo
2020-04-28Skip socket check on windowsUchio Kondo
2020-04-28Follow C90 styleUchio Kondo
2020-04-28Test mruby-io in tmpdir when AF_UNIX cannot be created on cwdUchio Kondo
2020-04-27Updating `parse.y for recent `bison` (retry).Yukihiro "Matz" Matsumoto
2020-04-27Revert "Change obsolete `%pure-parser` to `%define api.pure`."Yukihiro "Matz" Matsumoto
This reverts commit 682a31f92b3ac86ca59f7e8e740197e50b4452e5. Unfortunately, I couldn't run newer `bison` on TravisCI. Maybe next time.
2020-04-27Update `.travis.yml` to support newer `bison` on MacOS.Yukihiro "Matz" Matsumoto
If it doesn't work, I will revert the last update to `parse.y`.
2020-04-27Change obsolete `%pure-parser` to `%define api.pure`.Yukihiro "Matz" Matsumoto
Recent `bison` warns for `%pure-parser`. We kept it since MacOS only provide ancient `bison`, but the warning is noisy and there's no hope that Apple will upgrade `bison`. MacOS users must install the newer version of `bison`, by typing `brew install bison` for example. Note that `brew` does not overwrite the `bison` execution path automatically, so you need to update your `.bash_profile` as instructed by `brew`.
2020-04-27Merge pull request #4978 from dearblue/test-ensureYukihiro "Matz" Matsumoto
Integrate class `EnsureYieldBreak` under test
2020-04-27Merge pull request #4980 from dearblue/contextYukihiro "Matz" Matsumoto
Reduce `struct mrb_context`
2020-04-27Merge pull request #4979 from dearblue/mruby-binYukihiro "Matz" Matsumoto
Remove unused `mruby-error` in `mruby-bin-mruby`
2020-04-26Integrate class `EnsureYieldBreak` under testdearblue
2020-04-26Remove unused `mruby-error` in `mruby-bin-mruby`dearblue
2020-04-26Reduce `struct mrb_context`dearblue
2020-04-25Implemented argument forwarding by `...`Yukihiro "Matz" Matsumoto
2020-04-24Merge pull request #4976 from dearblue/splice-undefYukihiro "Matz" Matsumoto
Support `undef` for `mrb_ary_splice()` instead of `[]`
2020-04-24Merge pull request #4975 from dearblue/io-commentYukihiro "Matz" Matsumoto
Removed comments mentioning `MRB_WITHOUT_FLOAT`; ref 2e661e8
2020-04-24Removed comments mentioning `MRB_WITHOUT_FLOAT`; ref 2e661e8dearblue
The comment is for messages when `MRB_INT16` and `MRB_WITHOUT_FLOAT` are specified at the same time. The comment itself is no longer needed now that `MRB_INT16` is gone.
2020-04-24Support `undef` for `mrb_ary_splice()` instead of `[]`dearblue
When removing elements from an array, it is possible to avoid creating an empty array. Before this patch: ```c mrb_ary_splice(mrb, ary, head, len, mrb_ary_new(mrb)); ``` After this patch: ```c mrb_ary_splice(mrb, ary, head, len, mrb_undef_value()); ```
2020-04-22Fix `instance_exec` and `class_exec` to avoid crash on indirect calls.Yukihiro "Matz" Matsumoto
Thank you @shuujii to additional report on #4973
2020-04-22Make `mrb_obj_instance_eval` to use `mrb_singleton_class_ptr`; #4973Yukihiro "Matz" Matsumoto
2020-04-22Add new function `mrb_singleton_class_ptr()`; ref #4973Yukihiro "Matz" Matsumoto
The difference between `mrb_singleton_class` and `mrb_singleton_class_ptr`: - `mrb_singleton_class_ptr` returns `struct RClass*`. - `mrb_singleton_class_ptr` returns `NULL` on immediate values where `mrb_singleton_class` raises exceptions.
2020-04-21Removed comments mentioning `MRB_INT16`.Yukihiro "Matz" Matsumoto
2020-04-21Fix the bug by `#instance_eval` called via a method object; fix #4973Yukihiro "Matz" Matsumoto
The tranpoline code in 6a0b68f8b was wrong; reverted.
2020-04-21Simplified `mrb_obj_instance_eval`; ref #4973Yukihiro "Matz" Matsumoto
2020-04-21`Kernel#clone` and `Kernel#dup` no longer raise `TypeError`; fix #4974Yukihiro "Matz" Matsumoto
In ISO, those methods should raise `TypeError`, but the spec has been changed. The change was discussed in [Feature#12979].
2020-04-15Merge pull request #4968 from dearblue/check-fdYukihiro "Matz" Matsumoto
Check the file descriptor with `IO#initialize`; resolve #4966
2020-04-14Selecting fd should be less than `FD_SETSIZE`; close #4966Yukihiro "Matz" Matsumoto
2020-04-14Merge pull request #4972 from dearblue/boxnan-cptrYukihiro "Matz" Matsumoto
Fix `MRB_TT_CPTR` object with `MRB_NAN_BOXING`
2020-04-14Merge pull request #4969 from dearblue/nostdio-packYukihiro "Matz" Matsumoto
Support `MRB_DISABLE_STDIO` for mruby-pack; ref #4954
2020-04-14Merge pull request #4970 from dearblue/nostdio-sprintfYukihiro "Matz" Matsumoto
Support `MRB_DISABLE_STDIO` for mruby-sprintf; ref #4954
2020-04-14Merge pull request #4971 from dearblue/mruby-configYukihiro "Matz" Matsumoto
Fixed a build error in mruby-config
2020-04-13Fix `MRB_TT_CPTR` object with `MRB_NAN_BOXING`dearblue
Previously, if `MRB_NAN_BOXING` is defined, for example, `mrb_cptr_value()` could not keep an odd address. If it is `MRB_32BIT`, it can be embedded in `NaN` as it is. If it is `MRB_64BIT`, some operations are shared with `MRB_WORD_BOXING`. In this case, the MRB_API function `mrb_nan_boxing_cptr_value()` is defined.