summaryrefslogtreecommitdiffhomepage
path: root/src/vm.c
AgeCommit message (Collapse)Author
2018-09-07Clear terminated spacedearblue
2018-09-05Add `argv` and `argc` check in `OP_ENTER`; fix #4102Yukihiro "Matz" Matsumoto
`argv` may be retrieved from an array whose `ptr` is `NULL` when it`s empty.
2018-09-04Add type casts to silence MSVC warnings.Yukihiro "Matz" Matsumoto
2018-09-01Avoid warning in MSVC compilation.Yukihiro "Matz" Matsumoto
2018-08-30Use `mrb_ensure_hash_type()` to check if an operand is a `Hash`; fix #4097Yukihiro "Matz" Matsumoto
2018-08-30Need to clear `mrb->c->cibase->ridx` (toplevel ridx) at L_STOP; fix #4092Yukihiro "Matz" Matsumoto
This problem only appears when `mrb` executed multiple times (i.e. `mirb`)
2018-08-30The operand of `OP_ARYDUP` may not be an array; fix #4094Yukihiro "Matz" Matsumoto
This commit also fix #4096.
2018-08-29Fix off-by-one error in `OP_EPUSH` and `OP_ONERR`; fix #4095Yukihiro "Matz" Matsumoto
2018-08-29Check the size of rescue&ensure stacks; ref #4088Yukihiro "Matz" Matsumoto
Those small stack indexes can cause integer overflow.
2018-08-25Reduce integer casting warnings.Yukihiro "Matz" Matsumoto
2018-08-25fixup! New bytecode implementation of mruby VM.Yukihiro "Matz" Matsumoto
2018-08-25Hash splat `**` should not be ignored.Yukihiro "Matz" Matsumoto
Implemented by adding `OP_HASHCAT` that merges hashes.
2018-08-25Fixed a bug in `OP_HASHADD`.Yukihiro "Matz" Matsumoto
2018-08-25Add bytecode support for `MRB_WORD_BOXING`.Yukihiro "Matz" Matsumoto
2018-08-25New bytecode implementation of mruby VM.Yukihiro "Matz" Matsumoto
2018-08-25Remove utility functions: `mrb_vm_iv_{get,set}`.Yukihiro "Matz" Matsumoto
2018-08-25Remove `nregs` member from `mrb_callinfo`.Yukihiro "Matz" Matsumoto
This means reducing one word per a call frame.
2018-07-31Removed unused instruction: `OP_KDICT`.Yukihiro "Matz" Matsumoto
2018-07-31Fixed a small bug in keyword argument parsing.Yukihiro "Matz" Matsumoto
def m(a=1,**k) p [a,k] end m(a: 1)
2018-07-30Keyword argument implemented.Yukihiro "Matz" Matsumoto
2018-07-30New bytecode implementation of mruby VM.Yukihiro "Matz" Matsumoto
2018-06-14Restore GC arena after raised exceptions; ref #4042Yukihiro "Matz" Matsumoto
2018-06-11Revert "No longer need to insert write barriers for fibers."Yukihiro "Matz" Matsumoto
This reverts commit c6736357a72049a0eb2a31ccabcc3cd2baba7c9e. The assumption was wrong and caused the issue; fix #4020
2018-06-11Retrieve `b` operand from the instruction (for debugging); ref #4020Yukihiro "Matz" Matsumoto
2018-06-07Merge pull request #4039 from i110/i110/fix-broken-lexical-variablesYukihiro "Matz" Matsumoto
fix broken lexical variables
2018-06-07Export `stack_extend` function (renamed `mrb_stack_extend`); fix #3219Yukihiro "Matz" Matsumoto
This change is required to support #4038.
2018-06-06Revert "Fix heap use after free on mruby-aws-sigv4."Ichito Nagata
This reverts commit b8869498b7b1458af1cf2a5ccc7644849f826230.
2018-06-03fix env->stack misadjustingIchito Nagata
2018-05-03`env` referred from top-level callinfo should not be unshared; fix #4019Yukihiro "Matz" Matsumoto
Because `mirb` keeps top-level environment across each iteration.
2018-04-28Update `OP_APOST` description; ref #4008Yukihiro "Matz" Matsumoto
2018-04-27Fix heap use after free on mruby-aws-sigv4.Takeshi Watanabe
2018-04-13No longer need to insert write barriers for fibers.Yukihiro "Matz" Matsumoto
Those barriers are inserted to fix #3699 but all living fibers are marked from `mark_context()` anyway now.
2018-04-13The #3871 fix caused wrong `break from proc-closure` error; fix #3996Yukihiro "Matz" Matsumoto
2018-04-13Add `fallthrough` comment to silence gcc warning.Yukihiro "Matz" Matsumoto
2018-04-13Silence gcc initializer warning.Yukihiro "Matz" Matsumoto
2018-04-11Check length of env stack before accessing upvar; fix #3995Yukihiro "Matz" Matsumoto
2018-04-05Adjust environment when `mrb_exec_irep` happened.Takeshi Watanabe
2018-03-22Need to keep block argument in `mrb_exec_irep`; fix #3973Yukihiro "Matz" Matsumoto
2018-03-20Needed to set `ci->proc` in `OP_SUPER`; fix #3966Yukihiro "Matz" Matsumoto
2018-02-09Check `ensure` proc is NULL before calling; fix #3943Yukihiro "Matz" Matsumoto
2018-01-30Need not to pop `callinfo` on `OP_STOP`.Yukihiro "Matz" Matsumoto
2017-12-23`super` should raise `TypeError` when the receiver is switched; fix #3911Yukihiro "Matz" Matsumoto
The receiver can be switched using `#instance_eval` etc.
2017-12-23Avoid infinite recursion in `method_missing`; ref #3908Yukihiro "Matz" Matsumoto
2017-12-23May need more stack space in `mrb_funcall_with_block`; fix #3908Yukihiro "Matz" Matsumoto
2017-12-23Should not overwrite `ci->target_class` in `mrb_exec_irep()`.Yukihiro "Matz" Matsumoto
For example, the following code behaved wrong: ```ruby Object.instance_exec(1,2,3){|*a| def foo 42 end } p foo() ```
2017-12-20Fixed method look-up for `method_missing` in OP_SUPER; ref #3905Yukihiro "Matz" Matsumoto
Method look-up for `OP_SUPER` should start from the superclass of the `target_class` but if it fails, the look-up for `method_missing` should start from the class of the receiver. The following code explains the case: ```ruby class Bar def foo super end end class Foo<Bar def method_missing(mid, *) p mid end end ``` Foo.new.foo
2017-12-20The superclass info should be taken from `TARGET_CLASS(ci->proc).Yukihiro "Matz" Matsumoto
Not from `ci->target_class` that may be switched using `class_eval` etc. fix #3899, fix #3906 We found out there is a mruby specific limitation that `super` may be screwed up when a method is defined in a module and `super` is called in the block with the target class switched (for example, `super` in `class_eval` block). Now we raise `RuntimeError` for such cases. The following code works in CRuby but not in mruby. ``` module M def foo "aaa".singleton_class.class_eval{super 2} end end class Foo def foo(*); end end class Bar<Foo include M end Bar.new.foo ```
2017-12-16Need to set `ci->proc` before calling methods; fix #3902Yukihiro "Matz" Matsumoto
2017-12-16Need to clear exception handler on `return`; fix #3898Yukihiro "Matz" Matsumoto
2017-12-13Retrieve operands at the beginning of `OP_SCLASS`.Yukihiro "Matz" Matsumoto