Yukihiro "Matz" Matsumoto
b7c3a876f1
Add most recent call last message to the backtrace.
2017-11-29 16:56:10 +09:00
Yukihiro "Matz" Matsumoto
3e67a116d1
Call all ensure clauses pushed at OP_STOP.
2017-11-29 12:16:16 +09:00
Yukihiro "Matz" Matsumoto
afa53809e2
No need to use ecall_adjust().
2017-11-29 12:15:24 +09:00
Yukihiro "Matz" Matsumoto
f35f975d26
Fixed stack address adjustment in ecall(); fix #3859
2017-11-29 12:14:05 +09:00
Yukihiro "Matz" Matsumoto
d4fc980527
Need to evaluate ensure clauses at fiber termination.
2017-11-29 11:57:33 +09:00
Yukihiro "Matz" Matsumoto
6bb5ad786c
Remove unnecessary code; ref #3711
2017-11-29 11:44:07 +09:00
Yukihiro "Matz" Matsumoto
597149ae23
Change newline style of test/t/lang.rb (from DOS)
2017-11-22 16:10:28 +09:00
Yukihiro "Matz" Matsumoto
b4f9b031de
Some cosmetic changes
2017-11-22 16:09:50 +09:00
Yukihiro "Matz" Matsumoto
284a1d12ee
Provide shortcut comparison methods for numbers for performance.
2017-11-22 15:43:48 +09:00
Yukihiro "Matz" Matsumoto
0ab21a9a5e
Stack adjustment should be based on p->upper; fix #3857
...
It used to be based on `ci->proc` but the callinfo position may be
wrong when `ecall()` is called during stack rewinding from `OP_RETURN`.
2017-11-22 14:05:11 +09:00
Yukihiro "Matz" Matsumoto
fbafa78098
Clear ensure stack after calling in OP_EPOP; #3855 3856
2017-11-22 12:22:45 +09:00
Yukihiro "Matz" Matsumoto
4665b07f7b
No need to pop ensure stack if eidx is smaller than epos; #3855 #3856
2017-11-22 12:21:24 +09:00
Yukihiro "Matz" Matsumoto
fe3ac50845
fixup! Remove fixed argument of ecall(); ref #3855 #3856
2017-11-22 12:20:56 +09:00
Yukihiro "Matz" Matsumoto
cb4b042777
Remove fixed argument of ecall(); ref #3855 #3856
2017-11-22 12:19:40 +09:00
Yukihiro "Matz" Matsumoto
393133e741
Should have marked all ensure stack entries; fix #3855 fix #3856
2017-11-22 12:18:20 +09:00
Yukihiro "Matz" Matsumoto
8b7a8978e2
Reduce the size of struct RBreak to reduce memory usage.
...
The old size of `struct RBreak` was 56 bytes (`MRB_NO_BOXING`)
and it's bigger than other object structures. That increase the
size of `RVALUE` thus increase the total amount of memory consumption.
2017-11-20 18:33:41 +09:00
Yukihiro "Matz" Matsumoto
8f2c62407c
Add MRB_METHOD_TABLE_INLINE option.
...
Now the method tables (in classes/modules and caches) keeps C function
pointers without wrapping in `struct RProc` objects. For the sake of
portability, `mrb_method_t` is represented by the struct and union, but
if the most significant bit of the pointer is not used by the platform,
`mrb_method_t` should be packed in `uintptr_t` to reduce memory usage.
`MRB_METHOD_TABLE_INLINE` is turned on by default for linux.
2017-11-20 18:33:41 +09:00
Yukihiro "Matz" Matsumoto
6c06e77446
Add MRB_METHOD_CACHE description to include/mrbconf.h
2017-11-20 06:04:27 +09:00
Yukihiro "Matz" Matsumoto
6a9efd6849
Invoke mrb_full_gc() before ObjectSpace.count_objects.
2017-11-19 12:19:46 +09:00
Yukihiro "Matz" Matsumoto
9b2454c94d
Leave hash->ht to be NULL if initial capacity is zero.
2017-11-19 03:46:58 +09:00
Yukihiro "Matz" Matsumoto
7405821f5a
doc/limitaions.md: Remove infinite recursion entry.
...
It's fixed since 1.3.0
2017-11-18 21:16:22 +09:00
Yukihiro "Matz" Matsumoto
86f9254df0
doc/limitaions.md: Remove Kernel.binding entry.
...
Since no ISO classes/methods are not provided by mruby, there's
no use mentioning `Kernel.binding` here.
2017-11-18 21:14:19 +09:00
Yukihiro "Matz" Matsumoto
825e93eba4
Assign operands to local variables.
2017-11-18 00:03:59 +09:00
Yukihiro "Matz" Matsumoto
31ce73ddc3
Merge pull request #3853 from ukrainskiysergey/variable_c_cosmetic_changes
...
Removed useless condition
2017-11-18 00:03:50 +09:00
Ukrainskiy Sergey
a2d0ee59c6
Removed useless condition
2017-11-17 22:30:22 +09:00
Yukihiro "Matz" Matsumoto
269f9f2125
Merge pull request #3852 from dabroz/feature-array-transpose
...
implement Array.transpose
2017-11-17 21:50:34 +09:00
Tomasz Dąbrowski
e65fa4d7a2
implement Array.transpose
2017-11-17 12:39:34 +01:00
Yukihiro "Matz" Matsumoto
d01003ce3a
Merge pull request #3851 from ukrainskiysergey/variable_c_cosmetic_changes
...
Cosmetic changes in variable.c
2017-11-17 20:04:37 +09:00
Ukrainskiy Sergey
ddd32d74e1
Changed the assignment of a variable in variable.c
2017-11-17 19:43:57 +09:00
Ukrainskiy Sergey
74714c8fee
Changed numbers to TRUE and FALSE for mrb_bool in variable.c
2017-11-17 19:16:29 +09:00
Yukihiro "Matz" Matsumoto
c8da602752
Need to save stack space by number of registers from the current proc,
...
Not from the execution ensure proc; fix #3849
2017-11-17 01:08:46 +09:00
Yukihiro "Matz" Matsumoto
03a3bd9178
The number of argument should be retrieved by mrb_get_argc; fix #3848
...
You should not access `mrb->c->ci->argc` directly.
2017-11-13 16:16:38 +09:00
Yukihiro "Matz" Matsumoto
c210a8adf9
Fixed wrong stack extend size; fix #3847
2017-11-11 17:55:32 +09:00
Yukihiro "Matz" Matsumoto
181f980b6c
Need to clear stack region for local variables in eval; fix #3844
2017-11-10 21:53:12 +09:00
Yukihiro "Matz" Matsumoto
41c8c419cf
Use proper target_class to define class/module; fix #3843
...
The outer class of the class/module definition should be taken from
`MRB_TARGET_CLASS(mrb->c->ci->proc)` not `mrb->c->ci->target_class`
which is the target of constant lookups.
2017-11-09 00:14:21 +09:00
Yukihiro "Matz" Matsumoto
f723832ebc
Should allocate memory region before updating len; fix #3842
...
Otherwise half-baked string object will be allocated.
2017-11-08 08:46:55 +09:00
Yukihiro "Matz" Matsumoto
7ae20e0785
Simplify MRB_WITHOUT_FLOAT condtion
2017-11-08 08:45:59 +09:00
Yukihiro "Matz" Matsumoto
37f6e42293
Removed redundant function prototype.
2017-11-04 17:59:00 +09:00
Yukihiro "Matz" Matsumoto
d6cb4f9cf2
Merge branch 'pandax381-mrb_without_float'
2017-11-04 12:33:07 +09:00
Yukihiro "Matz" Matsumoto
a751f7f196
Make mirb to print warnings; ref #3827
2017-11-04 12:32:34 +09:00
Yukihiro "Matz" Matsumoto
fef4b394a7
Avoid compiling fmt_fp.c if MRB_WITHOUT_FLOAT is set; #3827
2017-11-04 12:12:52 +09:00
Yukihiro "Matz" Matsumoto
de2363a9f0
Merge branch 'mrb_without_float' of https://github.com/pandax381/mruby into pandax381-mrb_without_float
2017-11-04 11:49:25 +09:00
Yukihiro "Matz" Matsumoto
388d26d770
Reimplement block_given?; ref #3841
...
Make `block_given?` to search for the top of the scope first.
The top of the scope means either:
* the top method body
* the enclosing class body
* the top-level
The special case is the method defined by `define_method` with a
block as in #3841 . In cases like this, the method body (given by
a block) is not considered as the top of the scope. You need to use
`&block` in the block parameter if you want to know if a block is
given to the method.
This commit also changes the behavior of `MRB_PROC_SCOPE` flag.
Now it is only set if the `proc` is either a class body or a method
body defined in Ruby. It is no longer set for a block that given to
`define_method`.
2017-11-04 11:20:04 +09:00
Yukihiro "Matz" Matsumoto
ab27abe083
The bidx saved in env may be useless; fix #3841
...
When `block_given?` is called from a block given to `define_method`
as a method body, the `bidx` may not be within `env` saved closure.
In this case, it causes heap buffer overflow.
2017-11-04 03:01:37 +09:00
YAMAMOTO Masaya
625f9f6fa3
Merge branch 'master' of github.com:mruby/mruby
2017-11-04 01:23:12 +09:00
Yukihiro "Matz" Matsumoto
e7fe6ee263
Avoid pointer arithmetic in backtrace.c; #3816
2017-11-04 00:35:50 +09:00
Yukihiro "Matz" Matsumoto
12e38597c8
Always check division-by-zero to avoid undefined behavior; fix #3816
...
Also removed the code to normalize NaN value for `MRB_NAN_BOXING`.
Tha code was added to fix #1712 but no longer required after 249f05e7d .
2017-11-03 09:35:55 +09:00
Yukihiro "Matz" Matsumoto
d489b41c31
Reduce memory leaks from mirb.
2017-11-03 08:24:47 +09:00
Yukihiro "Matz" Matsumoto
e4662d77e7
Should not use FSHARED state for string from irep pools; fix #3829
...
This strings in `irep` pools may be freed forcefully in `mrb_irep_free`.
This commit probably fixes #3817 as well.
2017-11-03 08:24:47 +09:00
Yukihiro "Matz" Matsumoto
13a318b0c7
Merge pull request #3840 from iij/keep-backtrace-rethrown-exc
...
don't strip away backtrace info when an exception is re-thrown
2017-11-02 21:36:26 +09:00