[前][次][番号順一覧][スレッド一覧]

ruby-changes:45701

From: nobu <ko1@a...>
Date: Sat, 4 Mar 2017 23:44:09 +0900 (JST)
Subject: [ruby-changes:45701] nobu:r57774 (trunk): compile.c: operand size check

nobu	2017-03-04 23:44:05 +0900 (Sat, 04 Mar 2017)

  New Revision: 57774

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57774

  Log:
    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.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 57773)
+++ compile.c	(revision 57774)
@@ -7489,8 +7489,10 @@ ibf_load_code(const struct ibf_load *loa https://github.com/ruby/ruby/blob/trunk/compile.c#L7489
 		break;
 	    }
 	}
-	assert(insn_len(insn) == op_index+1);
-    };
+	if (insn_len(insn) != op_index+1) {
+	    rb_raise(rb_eRuntimeError, "operand size mismatch");
+	}
+    }
 
 
     return code;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]