- 16 Nov, 2020 6 commits
-
-
Yukihiro "Matz" Matsumoto authored
Merge pull request #5137 from shuujii/use-uintptr_t-instead-of-unsigned-long-in-include-mruby-boxing_word.h Use `uintptr_t` instead of `unsigned long` in `include/mruby/boxing_word.h`
-
Yukihiro "Matz" Matsumoto authored
Avoid undefined behavior
-
Yukihiro "Matz" Matsumoto authored
Simplify `obj_free`
-
KOBAYASHI Shuji authored
### ASAN report (`MRB_INT32`) ```console $ bin/mruby -ve '-0x40000000' mruby 3.0.0preview (2020-10-16) 00001 NODE_SCOPE: 00001 NODE_BEGIN: 00001 NODE_NEGATE: 00001 NODE_INT 40000000 base 16 irep 0x6070000001e0 nregs=2 nlocals=1 pools=0 syms=0 reps=0 iseq=9 file: -e /mruby/src/codedump.c:173:49: runtime error: left shift of 49152 by 16 places cannot be represented in type 'int' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mruby/src/codedump.c:173:49 in 1 000 OP_LOADI32 R1 -1073741824 1 006 OP_RETURN R1 1 008 OP_STOP /mruby/src/vm.c:1138:7: runtime error: left shift of 49152 by 16 places cannot be represented in type 'mrb_int' (aka 'int') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mruby/src/vm.c:1138:7 in ```
-
KOBAYASHI Shuji authored
-
KOBAYASHI Shuji authored
`mrb_bool` on LLP64 environment seems to become false if, for example, `mrb_value` is a pointer whose lower 32 bits are 0.
-
- 15 Nov, 2020 4 commits
-
-
Yukihiro "Matz" Matsumoto authored
Fix paths of gem files to be scanned for presym
-
Yukihiro "Matz" Matsumoto authored
Fix that large integer is not GCed with Word-boxing
-
KOBAYASHI Shuji authored
When building from outside `MRUBY_ROOT` (e.g. `rake -f`), gem files were not scanned.
-
KOBAYASHI Shuji authored
### Example (32-bit Word-boxing) ```ruby # example.rb int_count = ObjectSpace.count_objects[:T_INTEGER]||0 int = 1<<30 p (ObjectSpace.count_objects[:T_INTEGER]||0) - int_count int = nil GC.start p (ObjectSpace.count_objects[:T_INTEGER]||0) - int_count ``` #### Before this patch: ```console $ bin/mruby example.rb 1 1 ``` #### After this patch: ```console $ bin/mruby example.rb 1 0 ```
-
- 14 Nov, 2020 17 commits
-
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
Fix overflow detection in integer operations with `MRB_WORD_BOXING`. This bug made `1073741824 == 1073741824+0` to be `false` on 32bit platforms.
-
Yukihiro "Matz" Matsumoto authored
Should raise `RangeError` if the operation overflows.
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
Remove redundant command execution in `header_search_paths`
-
KOBAYASHI Shuji authored
There is no need to execute command in duplicate for the same reason as #5128.
-
Yukihiro "Matz" Matsumoto authored
Remove unused constant in `lib/mruby/build/command.rb`
-
Yukihiro "Matz" Matsumoto authored
Workaround to build `mirb` with Homebrew's readline on Mac; fix #4537
-
KOBAYASHI Shuji authored
-
KOBAYASHI Shuji authored
-
Yukihiro "Matz" Matsumoto authored
Simplify `MRuby::Command#_run` to avoid duplicated compilation
-
Yukihiro "Matz" Matsumoto authored
Don't use private structs with `mrb_mt_foreach()`
-
dearblue authored
The `MRB_API` function `mrb_mt_foreach()` previously used the private structure `struct mt_elem`. Therefore, use `mrb_method_t` instead.
-
- 13 Nov, 2020 9 commits
-
-
KOBAYASHI Shuji authored
ref: https://github.com/mruby/mruby/pull/4959#discussion_r402086196 Compiles twice because it falls back to `build.filename(command)` when `command` fails. This process was added at 9968af45 to support `ccache gcc` etc. At that time, it seems that it was necessary because `build.filename(command)` quoted the whole `command`, but now it does not quote, so we can just run `build.filename(command)`. ### Example ```console $ echo 1 > src/a.c $ rake -v ``` #### Before this patch: ```console (snip) gcc -std=gnu99 -g -O3 -Wall -Wundef -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wwrite-strings -I"/mruby/mruby/include" -MMD -o "/mruby/mruby/build/host/src/a.o" -c "/mruby/mruby/src/a.c" /mruby/mruby/src/a.c:1:1: error: expected identifier or '(' 1 ^ 1 error generated. gcc -std=gnu99 -g -O3 -Wall -Wundef -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wwrite-strings -I"/mruby/mruby/include" -MMD -o "/mruby/mruby/build/host/src/a.o" -c "/mruby/mruby/src/a.c" /mruby/mruby/src/a.c:1:1: error: expected identifier or '(' 1 ^ 1 error generated. rake aborted! (snip) ``` #### After this patch: ```console (snip) gcc -std=gnu99 -g -O3 -Wall -Wundef -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wwrite-strings -I"/mruby/mruby/include" -MMD -o "/mruby/mruby/build/host/src/a.o" -c "/mruby/mruby/src/a.c" /mruby/mruby/src/a.c:1:1: error: expected identifier or '(' 1 ^ 1 error generated. rake aborted! (snip) ```
-
Yukihiro "Matz" Matsumoto authored
Merge pull request #5127 from shuujii/include-size-of-iv-table-in-ObjectSpace.memsize_of-to-Hash-object Include size of iv table in `ObjectSpace.memsize_of` to `Hash` object
-
KOBAYASHI Shuji authored
-
Yukihiro "Matz" Matsumoto authored
Use `enable_sanitizer` to simplify `build_config/clang-asan.rb`
-
Yukihiro "Matz" Matsumoto authored
Rename `mrb_os_memsize_of_hash_table` to `mrb_hash_memsize`
-
KOBAYASHI Shuji authored
-
KOBAYASHI Shuji authored
* The term `hash_table` can be misleading because the return value of this function includes memory usage of entire `Hash` object, including not only hash table part but also entry list part, etc. * This function takes a `Hash` object as a receiver and is defined in `src/hash.c`, so it is natural to have a `mrb_hash_` prefix.
-
Yukihiro "Matz" Matsumoto authored
Change name and usage of presym macros
-
KOBAYASHI Shuji authored
To be also able to build mruby without presym in the future. However, `MRB_QSYM` has been removed and changed as follows: ### Example | Type | Symbol | Previous Style | New Style | |---------------------------|--------|------------------|----------------| | Operator | & | MRB_QSYM(and) | MRB_OPSYM(and) | | Class Variable | @@foo | MRB_QSYM(00_foo) | MRB_CVSYM(foo) | | Instance Variable | @foo | MRB_QSYM(0_foo) | MRB_IVSYM(foo) | | Method with Bang | foo! | MRB_QSYM(foo_b) | MRB_SYM_B(foo) | | Method with Question mark | foo? | MRB_QSYM(foo_p) | MRB_SYM_Q(foo) | | Mmethod with Equal | foo= | MRB_QSYM(foo_e) | MRB_SYM_E(foo) | This change makes it possible to define, for example, `MRB_IVSYM(foo)` as `mrb_intern_lit(mrb, "@" "foo")`, which is useful if we support building without presym in the future.
-
- 12 Nov, 2020 2 commits
-
-
Yukihiro "Matz" Matsumoto authored
Remove unused argument of `mrb_obj_iv_tbl_memsize`
-
KOBAYASHI Shuji authored
-
- 10 Nov, 2020 2 commits
-
-
Yukihiro "Matz" Matsumoto authored
Reduce memory usage of Hash object
-
Yukihiro "Matz" Matsumoto authored
Fix typo in backward compatible mrb_exc_new_str_lit() macro
-