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 | b2515d2bbfcb3a6e1632609d6f486e6d56ee6ecd (patch) | |
tree | 128334a1aeec16bb465294841a3eab4d101572c7 | |
parent | 41a76870dc8d2e19b82127772f9a0796cfa28633 (diff) | |
download | ruby-b2515d2bbfcb3a6e1632609d6f486e6d56ee6ecd.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
-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; |