OP_RETRUN to take B as matching exception; ref #3487
authorYukihiro "Matz" Matsumoto <[email protected]>
Sat, 11 Mar 2017 07:32:29 +0000 (11 16:32 +0900)
committerYukihiro "Matz" Matsumoto <[email protected]>
Sat, 11 Mar 2017 07:32:29 +0000 (11 16:32 +0900)
include/mruby/opcode.h
mrbgems/mruby-compiler/core/codegen.c

index 9dfa7f7..3d45448 100644 (file)
@@ -82,7 +82,7 @@ enum {
   OP_JMPIF,/*     A sBx   if R(A) pc+=sBx                                 */
   OP_JMPNOT,/*    A sBx   if !R(A) pc+=sBx                                */
   OP_ONERR,/*     sBx     rescue_push(pc+sBx)                             */
-  OP_RESCUE,/*    A       clear(exc); R(A) := exception (ignore when A=0) */
+  OP_RESCUE,/*    A B     R(A) := exc; R(B) := matched (ignore if A/B=0)  */
   OP_POPERR,/*    A       A.times{rescue_pop()}                           */
   OP_RAISE,/*     A       raise(R(A))                                     */
   OP_EPUSH,/*     Bx      ensure_push(SEQ[Bx])                            */