From ebddf6cca0abd98b3c24e8262ff4411bdbe884e8 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Thu, 28 May 2020 20:39:50 +0100 Subject: [PATCH] basic_block: Allow printing of invalid instruction pointers --- src/frontend/ir/basic_block.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/ir/basic_block.cpp b/src/frontend/ir/basic_block.cpp index 421e48fe..b7615f52 100644 --- a/src/frontend/ir/basic_block.cpp +++ b/src/frontend/ir/basic_block.cpp @@ -176,7 +176,10 @@ std::string DumpBlock(const IR::Block& block) { if (arg.IsEmpty()) { return ""; } else if (!arg.IsImmediate()) { - return fmt::format("%{}", inst_to_index.at(arg.GetInst())); + if (const auto iter = inst_to_index.find(arg.GetInst()); iter != inst_to_index.end()) { + return fmt::format("%{}", iter->second); + } + return fmt::format("%", reinterpret_cast(arg.GetInst())); } switch (arg.GetType()) { case Type::U1: