diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-04 14:44:05 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-04 14:44:05 +0000 |
commit | f01836cb3f8737fdccce08a5b815c552351f922b (patch) | |
tree | 128334a1aeec16bb465294841a3eab4d101572c7 /compile.c | |
parent | 37102f6bdba6ca819dc96fc13ebc44087115ec08 (diff) | |
download | ruby-f01836cb3f8737fdccce08a5b815c552351f922b.tar.gz |
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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; |