Explorar o código

LibWasm: Print the block type for structured arguments

Ali Mohammad Pur %!s(int64=3) %!d(string=hai) anos
pai
achega
d471405caf
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      Userland/Libraries/LibWasm/Printer/Printer.cpp

+ 7 - 1
Userland/Libraries/LibWasm/Printer/Printer.cpp

@@ -434,7 +434,13 @@ void Printer::print(Wasm::Instruction const& instruction)
             [&](TableIndex const& index) { print("(table index {})", index.value()); },
             [&](Instruction::IndirectCallArgs const& args) { print("(indirect (type index {}) (table index {}))", args.type.value(), args.table.value()); },
             [&](Instruction::MemoryArgument const& args) { print("(memory (align {}) (offset {}))", args.align, args.offset); },
-            [&](Instruction::StructuredInstructionArgs const& args) { print("(structured (else {}) (end {}))", args.else_ip.has_value() ? String::number(args.else_ip->value()) : "(none)", args.end_ip.value()); },
+            [&](Instruction::StructuredInstructionArgs const& args) {
+                print("(structured\n");
+                TemporaryChange change { m_indent, m_indent + 1 };
+                print(args.block_type);
+                print_indent();
+                print("(else {}) (end {}))", args.else_ip.has_value() ? String::number(args.else_ip->value()) : "(none)", args.end_ip.value());
+            },
             [&](Instruction::TableBranchArgs const& args) {
                 print("(table_branch");
                 for (auto& label : args.labels)