Yukihiro "Matz" Matsumoto
15945e14b9
Revert "Make mrb_load_exec a static function."
...
This reverts commit 7944d9a6d4 .
Because it voids #3248 and #3331 . But we should add better way
to check whether compile errors occur without duplicated callings.
2017-06-28 16:00:59 +09:00
Yukihiro "Matz" Matsumoto
f0abd4241f
Avoid mrb_funcall() unless absolutely necessary; ref #3722
...
As a result, `#chr` is not called for ch < 0x80, so we need to
update the "invalid chr" test.
2017-06-28 12:03:53 +09:00
Yukihiro "Matz" Matsumoto
3554a41a54
Remove unnecessary initialization of a local variable.
2017-06-27 22:48:06 +09:00
Yukihiro "Matz" Matsumoto
877e16501c
No longer need to copy argv from mrb_get_args; ref #3722
2017-06-27 22:47:26 +09:00
Yukihiro "Matz" Matsumoto
1a3b32343e
Copy argv from VM stack to avoid use-after-free; fix #3722
2017-06-27 22:43:37 +09:00
Yukihiro "Matz" Matsumoto
b30eba6a13
Make LocalJumpError a subclass of ScriptError.
...
It's incompatible with CRuby, but it is required for mruby because
it cannot detect `break` outside of loops in the parsing time, but
in the code generation time where it cannot raise `SyntaxError`.
2017-06-23 18:08:38 +09:00
Yukihiro "Matz" Matsumoto
d0717efda6
Should raise an exception if break called in ensure; fix #3721
2017-06-23 18:08:04 +09:00
Yukihiro "Matz" Matsumoto
7944d9a6d4
Make mrb_load_exec a static function.
2017-06-23 17:56:12 +09:00
Yukihiro "Matz" Matsumoto
9a59cd7af8
Silence mrbmemcpy and mrbmemset warnings.
2017-06-23 17:54:02 +09:00
Yukihiro "Matz" Matsumoto
b200c7475a
No need to mark stacks of terminated fibers; fix #3720
2017-06-22 02:05:14 +09:00
Yukihiro "Matz" Matsumoto
c41e262667
Add write barrier to protect singleton class from GC; fix #3717
2017-06-22 01:20:22 +09:00
Yukihiro "Matz" Matsumoto
af0bef6dd8
Silence rubocop warnings.
2017-06-22 00:27:17 +09:00
Yukihiro "Matz" Matsumoto
e8a4e4262a
Add write barrier to protect proc reference from fiber; fix #3719
2017-06-21 17:59:14 +09:00
Yukihiro "Matz" Matsumoto
464d3fc0a3
Use alias enum_for to_enum instead of alias :enum_for :to_enum.
2017-06-21 11:13:43 +09:00
Yukihiro "Matz" Matsumoto
057be5ffb5
use unless instead of if not.
2017-06-21 11:13:33 +09:00
Yukihiro "Matz" Matsumoto
d0a7e01d9c
Should call ecall() before callinfo adjustment; fix #3715
2017-06-21 02:51:55 +09:00
Yukihiro "Matz" Matsumoto
bf1cb87b34
Array size can be cause integer overflow; fix #3710
2017-06-20 20:19:37 +09:00
Yukihiro "Matz" Matsumoto
39779b339e
Merge pull request #3718 from miura1729/original
...
#3711 fix
2017-06-20 16:18:07 +09:00
Miura Hideki
0fa94f9ead
#3711 fix
2017-06-20 12:50:00 +09:00
Yukihiro "Matz" Matsumoto
615e7e44e3
Avoid using snprintf(3) in case MRB_DISABLE_STDIO; fix #3714
2017-06-20 09:39:33 +09:00
Yukihiro "Matz" Matsumoto
455f3954dc
Merge pull request #3713 from Asmod4n/patch-2
...
Save gc_arena after buffer got allocated
2017-06-20 09:16:38 +09:00
Asmod4n
abca63c73b
Save gc_arena after buffer got allocated
...
Latest fix was freeing the buffer while it was still in use.
Fixes #3712
2017-06-19 20:27:38 +02:00
Yukihiro "Matz" Matsumoto
0de7eec628
Fixed disclosure of local variables by eval; ref #3710
...
This patch fixes the latter part of #3710 . We need to change
`struct REnv` to fix the former part of the issue.
2017-06-19 22:00:16 +09:00
Yukihiro "Matz" Matsumoto
4d3027b08e
Increment the version number to 1.3.0.
2017-06-19 16:47:25 +09:00
Yukihiro "Matz" Matsumoto
ea250d5f52
Increment RITE_BINARY_FORMAT_VER.
...
The behavior of `OP_RAISE` has been changed.
2017-06-19 09:23:03 +09:00
Yukihiro "Matz" Matsumoto
667e788159
Use mrb_int instead of int as argument to mrb_hash_new_capa.
2017-06-19 09:21:07 +09:00
Yukihiro "Matz" Matsumoto
b0f918d1bd
Use mrb_int instead of int.
2017-06-17 10:51:23 +09:00
Yukihiro "Matz" Matsumoto
4b55174fc5
Merge pull request #3706 from MasahikoSawada/fix_typo
...
Fix a typo in gc.c.
2017-06-17 08:40:57 +09:00
Yukihiro "Matz" Matsumoto
08c385ff66
Mark the GC arena in final_marking_phase.
...
Arena can be modified during the marking phase.
2017-06-17 08:39:43 +09:00
Yukihiro "Matz" Matsumoto
819ccd3b85
Mark the root context in final_marking_phase.
...
Because the root context cannot be marked from fibers.
2017-06-17 08:39:43 +09:00
Yukihiro "Matz" Matsumoto
8daabe7115
Mark global variables in final_marking_phase; fix #3704
2017-06-17 08:39:43 +09:00
Yukihiro "Matz" Matsumoto
a985847224
Store operands to local variables.
...
Mostly for debugging purpose.
2017-06-17 08:39:43 +09:00
Yukihiro "Matz" Matsumoto
497a0a791e
Correct comments in gc.c
2017-06-17 08:39:43 +09:00
Yukihiro "Matz" Matsumoto
aa8121cf3a
Use mrb_int instead of size_t for array capacity and length.
2017-06-17 08:39:43 +09:00
Masahiko Sawada
4f0900ef6e
Fix a typo in gc.c.
2017-06-17 00:06:16 +09:00
Yukihiro "Matz" Matsumoto
0411cea2df
Use MRB_PRId instead of d for mrb_int decimal specifier; ref #3701
2017-06-16 11:50:38 +09:00
Yukihiro "Matz" Matsumoto
6fdf2b035d
Merge branch 'ksss-string-upto'
2017-06-16 11:48:32 +09:00
Yukihiro "Matz" Matsumoto
e96f254ead
Use mrb_str_new() instead of malloc(); ref #3701
...
Otherwise the function may terminate and cause memory leaks.
2017-06-16 11:46:40 +09:00
Yukihiro "Matz" Matsumoto
473b2bb20d
Should not use sizeof(buf) when buf is char*; #3701
2017-06-16 11:42:51 +09:00
Yukihiro "Matz" Matsumoto
a7770a39aa
Merge branch 'string-upto' of https://github.com/ksss/mruby into ksss-string-upto
2017-06-16 11:35:42 +09:00
Yukihiro "Matz" Matsumoto
d4d99dd6d7
Allow break from a block called by mrb_yield; close #3359
...
This means #3701 is now OK to merge.
2017-06-16 11:34:11 +09:00
Yukihiro "Matz" Matsumoto
9e6a3f6c95
Use MRB_THROW instead of mrb_exc_raise.
2017-06-16 11:22:17 +09:00
Yukihiro "Matz" Matsumoto
6a66ce10b3
Need to unshare env from top callinfo; fix #3685
2017-06-16 08:25:34 +09:00
Yukihiro "Matz" Matsumoto
ebd6636a1e
Call write barriers for stack-modified fibers; fix #3699
2017-06-15 23:20:36 +09:00
Yukihiro "Matz" Matsumoto
d7e09ffa5f
Print the file name along with line number on syntax errors; fix #3698
2017-06-15 15:46:03 +09:00
Yukihiro "Matz" Matsumoto
47bd44fce1
Prevent Fiber#initialize to be called twice; fix #3705
2017-06-15 15:16:56 +09:00
Yukihiro "Matz" Matsumoto
b298e241c8
Protect the last exception object from GC in ecall; fix #3702
2017-06-15 14:57:18 +09:00
Yukihiro "Matz" Matsumoto
357e478e2c
Mark the exception object in the final marking phase; ref #3702
2017-06-15 14:53:49 +09:00
Yukihiro "Matz" Matsumoto
52443c80e2
Save the register value in a local variable for ease of debugging.
2017-06-15 14:52:58 +09:00
Yukihiro "Matz" Matsumoto
988e2ced03
Ensure size of the stack before handling exceptions; fix #3693
2017-06-15 13:37:27 +09:00