From f01836cb3f8737fdccce08a5b815c552351f922b Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 4 Mar 2017 14:44:05 +0000 Subject: compile.c: operand size check * compile.c (ibf_load_code): raise an exception on invalid operand size. should not use assert() to validate incoming data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compile.c b/compile.c index 6fd0c2a2fd..e295f2eddb 100644 --- a/compile.c +++ b/compile.c @@ -7489,8 +7489,10 @@ ibf_load_code(const struct ibf_load *load, const rb_iseq_t *iseq, const struct r break; } } - assert(insn_len(insn) == op_index+1); - }; + if (insn_len(insn) != op_index+1) { + rb_raise(rb_eRuntimeError, "operand size mismatch"); + } + } return code; -- cgit v1.2.3