Commit 9c9c945f authored by franzih's avatar franzih Committed by Commit bot

[interpreter] Add check for max number of operands.

BUG=

Review-Url: https://codereview.chromium.org/2565093003
Cr-Commit-Position: refs/heads/master@{#41630}
parent 5561c17a
...@@ -235,6 +235,8 @@ class BytecodeNodeBuilder { ...@@ -235,6 +235,8 @@ class BytecodeNodeBuilder {
#define DEFINE_BYTECODE_OUTPUT(name, accumulator_use, ...) \ #define DEFINE_BYTECODE_OUTPUT(name, accumulator_use, ...) \
template <typename... Operands> \ template <typename... Operands> \
void BytecodeArrayBuilder::Output##name(Operands... 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...>( \ BytecodeNode node(BytecodeNodeBuilder<__VA_ARGS__>::Make<Operands...>( \
this, CurrentSourcePosition(Bytecode::k##name), Bytecode::k##name, \ this, CurrentSourcePosition(Bytecode::k##name), Bytecode::k##name, \
operands...)); \ operands...)); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment