From 7f4b57bb2029b52a3ef136588e06721b53b10bf8 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 5 Sep 2017 21:11:41 +0900 Subject: Restrict `OP_EPOP` operand to `1`; ref #3789 --- mrbgems/mruby-compiler/core/codegen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index 8f15a9b18..5bb0545c4 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -279,10 +279,20 @@ genop_peep(codegen_scope *s, mrb_code i, int val) } break; case OP_EPOP: +#if 1 + if (GETARG_A(i) > 1) { + int j, len = GETARG_A(i), n; + for (j=0; jiseq[s->pc-1] = MKOP_A(OP_EPOP, GETARG_A(i0)+GETARG_A(i)); return 0; } +#endif break; case OP_POPERR: if (c0 == OP_POPERR) { -- cgit v1.2.3