1367 Commits

Author SHA1 Message Date
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 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 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 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
ksss 4d9ca27ba6 Use malloc instead of dynamic allocation 2017-06-14 18:28:39 +09:00
ksss 432a813905 Fix arena overflow error 2017-06-14 18:12:56 +09:00
ksss 19785f43d1 Reimplement String#upto 2017-06-14 17:30:31 +09:00
Yukihiro "Matz" Matsumoto b9f771dc50 Handles exceptions from code generation phase; fix #3695 2017-06-07 13:29:08 +09:00
Yukihiro "Matz" Matsumoto fc7096f18a Limit recursion level of codegen(); fix #3690 2017-06-05 13:18:31 +09:00
Yukihiro "Matz" Matsumoto 7f417ade42 Revert "Update NODE_BLOCK check logic in void_expr_error."
This reverts commit 31e30686b0.
2017-06-02 13:31:03 +09:00
Yukihiro "Matz" Matsumoto 31e30686b0 Update NODE_BLOCK check logic in void_expr_error. 2017-06-02 13:01:29 +09:00
Yukihiro "Matz" Matsumoto 0f2f021330 Fixed a bug in void_expr_error. 2017-06-02 12:06:40 +09:00
Yukihiro "Matz" Matsumoto b59d244c0d Add more precise void expression checks; ref #3686 2017-06-02 11:53:26 +09:00
Yukihiro "Matz" Matsumoto a893877b0d Check for super using OP_ARGARY; fix #3678
It generates a wasted empty array for each `super` call though.
It should be fixed in the future, if possible.
2017-06-01 09:38:42 +09:00
Yukihiro "Matz" Matsumoto cbd4aae41c Mark the proc object representing top-level as an internal object; #3621 2017-05-29 14:13:17 +09:00
Yukihiro "Matz" Matsumoto 7e4731655f Fixed off-by-one error in fiber_switch(); ref #3641 2017-05-26 01:24:28 +09:00
Yukihiro "Matz" Matsumoto ac442bc1df Raise an exception when transfer arguments are too many; fix #3641
The fix was proposed by @block8437.  Thank you.
2017-05-25 21:39:13 +09:00
Yukihiro "Matz" Matsumoto 5e1a6a2cc2 Make gen_assignment() to support NODE_SCALL; ref #3658 2017-05-25 12:40:49 +09:00
Yukihiro "Matz" Matsumoto 3ef97e3dd9 Under MRB_INT64, width may be bigger than INT_MAX; fix #3665 2017-05-25 10:40:35 +09:00
Yukihiro "Matz" Matsumoto d2458e66c2 Remove class info from backtrace lines. 2017-05-23 23:50:42 +09:00
ksss 98f9c33fe0 String#concat: Try to convert when not string 2017-05-21 10:30:27 +09:00
Clayton Smith bf30b8e8bf Change return back to break in the default case. 2017-05-12 14:43:12 -04:00
ksss 30df7c8762 Fix segmentation fault ref: #3648 2017-05-08 23:18:14 +09:00
Nobuyoshi Nakada ef6e14ee2b Better error message
Raise argument error with the better message, at the only place
where the size to fill can be negative.
2017-04-29 10:17:24 +09:00
Nobuyoshi Nakada e05c30738e Use FILL and PUSH
Instead of loop or `memcpy` after `CHECK`, use dedicated macros,
`FILL` and `PUSH`, respectively.
2017-04-29 10:10:31 +09:00
Yukihiro "Matz" Matsumoto 3e07a2d77c Silence warnings caused by implicit type casting. 2017-04-25 21:00:16 +09:00
Yukihiro "Matz" Matsumoto 92dcfbaab3 Add explicit cast from double to long. 2017-04-25 17:43:03 +09:00
Yukihiro "Matz" Matsumoto 88cd807379 Avoid use of snprintf() when DISABLE_STDIO is set; fix #3632
ref #3492 #3515 #3517
2017-04-25 10:41:50 +09:00
Yukihiro "Matz" Matsumoto 6088276cc8 Merge pull request #3630 from nobu/bug/sprintf-sp3inf
Fix space flag with inf/nan
2017-04-24 09:06:57 +09:00
Nobuyoshi Nakada d54f9f8f78 Fix embedded document with unterminated terminator
`skips()` is `mrb_bool` function, should return `FALSE` at EOF, not
`EOF`.
2017-04-23 11:41:00 +09:00
Nobuyoshi Nakada cd4e9a0518 Refactor "%f" % Inf/NaN
As for non-finite float, calculate the exact needed size with the
space flag.
2017-04-23 09:54:44 +09:00
Nobuyoshi Nakada 7314423bd1 Fix space flag when Inf/NaN and width==3
While `"% 2f"` and `"% 4f"` result in `" Inf"` and `" Inf"`
respectively, `"% 3f"` results in `"Inf"` (no space).
2017-04-23 09:54:20 +09:00
Yukihiro "Matz" Matsumoto 809b7ca3f4 Merge pull request #3628 from yyamano/libmruby-path
Add --libmruby-path support to mruby-bin-mruby-config.
2017-04-22 15:16:57 +09:00
Yukihiro "Matz" Matsumoto 5513fcee22 Keep reference to mrb_context from env; fix #3619 2017-04-22 14:35:36 +09:00
Yuji Yamano 52a03800d3 Add --libmruby-path support to mruby-bin-mruby-config. 2017-04-22 14:09:06 +09:00
Yukihiro "Matz" Matsumoto 3b0a36d399 Alias should push() extra stack space for blocks. 2017-04-22 12:03:56 +09:00
Yukihiro "Matz" Matsumoto 95229ee164 Assign to local variable first; cosmetic change. 2017-04-21 22:29:28 +09:00
Yukihiro "Matz" Matsumoto c900fff9a1 Merge pull request #3623 from take-cheeze/struct_freeze
Support `freeze` method in `Struct`.
2017-04-21 22:28:32 +09:00
Yuji Yamano 33d09e4ad0 Fix typo in usage message. 2017-04-21 04:32:41 -04:00
take_cheeze da5b7fa769 Support freeze in Struct. 2017-04-21 17:23:54 +09:00
Yukihiro "Matz" Matsumoto 62dae09bf6 Allow mrb_objspace_each_objects() to break iteration; ref #3359 2017-04-20 15:44:56 +09:00
Yukihiro "Matz" Matsumoto 6a0b68f8b8 Use trampoline technique for instance_exec; ref #3359
A new function `mrb_yield_cont()` is provided. You have to call it
at the end of a C defined method, e.g. `return mrb_yield_cont()`.
2017-04-19 19:54:55 +09:00
Yukihiro "Matz" Matsumoto f4119f518f Changed evaluation order of yield; ref #3613
So that `yield expr_with_error` will cause the error from the
argument rather than `LocalJumpError` when no block is given.
2017-04-18 12:00:52 +09:00
Clayton Smith 8e2279d1ff Fix an off-by-one causing a buffer overflow in mirb. 2017-04-13 10:51:26 -04:00
Yukihiro "Matz" Matsumoto 17377af984 Struct may not be initialized in #to_h; fix #3607 2017-04-13 10:51:16 +09:00
Yukihiro "Matz" Matsumoto 3123549bcb Fixed a bug in NODE_XSTR code generation; fix #3605 2017-04-13 00:38:47 +09:00