Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1110)

Unified Diff: src/interpreter/bytecode-array-builder.cc

Issue 2565093003: [interpreter] Add check for max number of operands. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index dfc5d183e0e782d01be5082857e91d8e9f52e869..605018232789b6098779a560438e436877873ce7 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -235,6 +235,8 @@ class BytecodeNodeBuilder {
#define DEFINE_BYTECODE_OUTPUT(name, accumulator_use, ...) \
template <typename... Operands> \
void BytecodeArrayBuilder::Output##name(Operands... operands) { \
+ static_assert(sizeof...(Operands) <= Bytecodes::kMaxOperands, \
+ "too many operands for bytecode"); \
BytecodeNode node(BytecodeNodeBuilder<__VA_ARGS__>::Make<Operands...>( \
this, CurrentSourcePosition(Bytecode::k##name), Bytecode::k##name, \
operands...)); \
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698