diff options
| author | dearblue <[email protected]> | 2020-05-24 11:44:31 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:21:32 +0900 |
| commit | f467b02d4598ab64d98727348e8a9c4f04fc9b83 (patch) | |
| tree | b5c4fdda5178b33ce9014054df0c0ec4b6caa93a /include | |
| parent | a54a3df32c379a6953664f1d9241c731066915ec (diff) | |
| download | mruby-f467b02d4598ab64d98727348e8a9c4f04fc9b83.tar.gz mruby-f467b02d4598ab64d98727348e8a9c4f04fc9b83.zip | |
Extended `OP_EXCEPT` and `OP_RAISE` (`OP_RAISEIF`) instructions
- `OP_EXCEPT` checks if `mrb->exc` is `NULL`, `MRB_TT_EXCEPTION` or
`MRB_TT_BREAK`.
If `mrb->exc` is `NULL`, it will be replaced with `nil`.
- If `OP_RAISE` is `nil`, it does nothing and the immediately
following instruction is executed (like `OP_NOP`).
Also, in case of `RBreak` object, it moves to the processing for
`break`.
With this change, the instruction name is changed from
`OP_RAISE` to `OP_RAISEIF`.
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby/ops.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/mruby/ops.h b/include/mruby/ops.h index 7d20ac0ad..45397e2ed 100644 --- a/include/mruby/ops.h +++ b/include/mruby/ops.h @@ -53,7 +53,7 @@ OPCODE(ONERR, S) /* rescue_push(a) */ OPCODE(EXCEPT, B) /* R(a) = exc */ OPCODE(RESCUE, BB) /* R(b) = R(a).isa?(R(b)) */ OPCODE(POPERR, B) /* a.times{rescue_pop()} */ -OPCODE(RAISE, B) /* raise(R(a)) */ +OPCODE(RAISEIF, B) /* raise(R(a)) if R(a) */ OPCODE(EPUSH, B) /* ensure_push(SEQ[a]) */ OPCODE(EPOP, B) /* A.times{ensure_pop().call} */ OPCODE(SENDV, BB) /* R(a) = call(R(a),Syms(b),*R(a+1)) */ |
