File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Libraries/LibWasm/AbstractMachine Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2091,6 +2091,16 @@ VALIDATE_INSTRUCTION(try_table)
20912091{
20922092 auto & args = instruction.arguments ().get <Instruction::TryTableArgs>();
20932093 auto block_type = TRY (validate (args.try_ .block_type ));
2094+
2095+ auto & parameters = block_type.parameters ();
2096+ for (size_t i = 1 ; i <= parameters.size (); ++i)
2097+ TRY (stack.take (parameters[parameters.size () - i]));
2098+
2099+ m_frames.empend (block_type, FrameKind::TryTable, stack.size ());
2100+ m_max_frame_size = max (m_max_frame_size, m_frames.size ());
2101+ for (auto & parameter : parameters)
2102+ stack.append (parameter);
2103+
20942104 for (auto & catch_ : args.catches ) {
20952105 auto label = catch_.target_label ();
20962106 TRY (validate (label));
Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ class Validator {
151151 If,
152152 Else,
153153 Function,
154+ TryTable,
154155 };
155156
156157 struct Frame {
You can’t perform that action at this time.
0 commit comments