Commit Graph

8242 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto adf453a584 Add "*!" argument specifier to avoid stack copying. 2017-07-12 14:48:23 +09:00
Yukihiro "Matz" Matsumoto 059d707e3a Add ary_modify_check() to Array#unshift; ref #3737 2017-07-12 14:44:36 +09:00
Yukihiro "Matz" Matsumoto e1de86134d Merge pull request #3740 from christopheraue/fix_test_output
fixed printing failed assertions
2017-07-12 08:24:02 +09:00
Christopher Aue 495a2e605d fixed printing failed assertions 2017-07-11 12:53:48 +02:00
Yukihiro "Matz" Matsumoto fc666bfe20 POSFIXABLE and NEGFIXABLE should take one argument. 2017-07-11 09:02:24 +09:00
Yukihiro "Matz" Matsumoto 46dee5716f Resurrect POSFIXABLE and NEGFIXABLE; ref 9186828 2017-07-10 09:42:48 +09:00
Yukihiro "Matz" Matsumoto 01fce3dc35 Merge pull request #3739 from ksss/array-shift
Should only check frozen fix #3737
2017-07-09 19:58:11 +09:00
ksss bf48473cf6 Should only check frozen for Array#pop 2017-07-09 18:05:21 +09:00
ksss c76dc33116 Add frozen test for Array#shift 2017-07-09 17:53:12 +09:00
ksss e581f2ed97 Should only check frozen fix #3737 2017-07-09 17:47:10 +09:00
Yukihiro "Matz" Matsumoto ce6c05600a Add fallback definitions of DBL_EPSILPN and LDBL_EPSILON; fix #3733
This is a workaround for mingw-w64 (5.3.1) bug.
2017-07-07 22:47:49 +09:00
Yukihiro "Matz" Matsumoto 718a9ceb6e Reduce allocation size of backtrace arrays. 2017-07-06 09:33:53 +09:00
Yukihiro "Matz" Matsumoto 542f0f7b16 Avoid out-of-bounds access of the backtrace array. 2017-07-06 09:32:28 +09:00
Yukihiro "Matz" Matsumoto 91868286be FIXABLE_FLOAT() fails sometimes in MRB_INT64 environment. 2017-07-06 09:05:46 +09:00
Yukihiro "Matz" Matsumoto cc04f03393 print("%d", 0) should not print -0; fix #3731 2017-07-05 23:31:50 +09:00
Yukihiro "Matz" Matsumoto 2ef5d22b60 Put a space between error position and error message.
For readability's sake.
2017-07-05 18:34:27 +09:00
Yukihiro "Matz" Matsumoto b68e7a605c Negation was not a good way to handle negative integers; fix #3729
There's a number that negation does not work (-2147483648 in 32bit
environment).
2017-07-05 18:13:37 +09:00
Yukihiro "Matz" Matsumoto b643a1a8bc In Ruby, sprintf specifier %u should behave as %d; fix #3730
Since there's no unsigned integer in Ruby. Binary, octal and
hexadecimal negative numbers can be represented by using 2's
compliment. But decimal (not being power of 2) cannot be use
that kind of format.
2017-07-05 17:48:40 +09:00
Yukihiro "Matz" Matsumoto bd66c5d716 Check stack size before accessing env stack; fix #3727 2017-07-05 09:19:06 +09:00
Yukihiro "Matz" Matsumoto cc01dedc65 Avoid undefined behavior of left shifting negative integer; #3728 2017-07-05 03:11:39 +09:00
Yukihiro "Matz" Matsumoto c377d504f6 Avoid undefined behavior of signed integer overflow; fix #3728 2017-07-05 03:11:39 +09:00
Yukihiro "Matz" Matsumoto c6bd8ceab7 Merge pull request #3726 from mruby/stable
mruby-1.3.0
2017-07-04 15:46:38 +09:00
Hiroshi Mimaki 277391e1b2 Set the mruby-1.3.0 release date to 2017-7-4. 1.3.0 2017-07-04 09:15:16 +09:00
Yukihiro "Matz" Matsumoto e9cdc88008 Refactor sprintf() code. 2017-07-04 08:50:39 +09:00
Yukihiro "Matz" Matsumoto 31bc2b0009 Initialize flags for each loop. 2017-07-04 08:46:33 +09:00
Hiroshi Mimaki ba1cd56ffa Fixed an unit test to work on Cygwin. 2017-07-03 16:01:01 +09:00
Yukihiro "Matz" Matsumoto 9b8956cdd0 break should not cross fiber-context boundary; fix #3724 2017-07-01 12:45:27 +09:00
Yukihiro "Matz" Matsumoto 7d99830211 super may be called from a block; fix #3723 2017-07-01 12:45:27 +09:00
Yukihiro "Matz" Matsumoto 466a18b0d3 Remove redundant use of Object#to_s in interpolation. 2017-06-28 23:28:24 +09:00
Yukihiro "Matz" Matsumoto aee1476ebd Provide better way to check compile errors.
Now you can just call `mrb_load_*` functions then check
`context->parser_nerr > 0` if the return value is `undef`,
instead of calling `mrb_parse_*` functions independently.
ref #3248 #3331
2017-06-28 16:04:40 +09:00
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