summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-04 14:44:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-04 14:44:05 +0000
commitf01836cb3f8737fdccce08a5b815c552351f922b (patch)
tree128334a1aeec16bb465294841a3eab4d101572c7 /compile.c
parent37102f6bdba6ca819dc96fc13ebc44087115ec08 (diff)
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
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c6
1 files 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;