Skip to content

Commit c9e01e1

Browse files
committed
Fixed issue with json parser
1 parent 211fb11 commit c9e01e1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/InstGenerator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,12 @@ namespace olympia
8282
}
8383
else
8484
{
85-
if (const auto it = jinst.find("mnemonic"); it == jinst.end())
85+
const auto mit = jinst.find("mnemonic");
86+
if (mit == jinst.end())
8687
{
8788
throw sparta::SpartaException() << "Missing mnemonic at " << curr_inst_index_;
8889
}
89-
const std::string mnemonic = boost::json::serialize(jinst.at("mnemonic"));
90+
const std::string mnemonic = boost::json::value_to<std::string>(mit->value());
9091

9192
auto addElement = [&jinst](mavis::OperandInfo & operands, const std::string & key,
9293
const mavis::InstMetaData::OperandFieldID operand_field_id,

0 commit comments

Comments
 (0)