Skip to content

Commit ab46f2e

Browse files
alice-mchkostorr
authored andcommitted
[MCH] fixed issues in IC communication
The issues are al related to the intepretation of the fields in the Ic::Data structure, which is of type boost::variant and is accessed via boost::get Without those fixes, one gets several boost::bad_get exceptions.
1 parent e07b9e1 commit ab46f2e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Ic.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ std::vector<std::pair<Ic::Operation, Ic::Data>> Ic::executeSequence(std::vector<
170170
Data data = it.second;
171171
try {
172172
if (operation == Operation::Read) {
173-
auto out = read(boost::get<uint32_t>(data));
173+
auto out = read(boost::get<IcData>(data));
174174
ret.push_back({ operation, out });
175175
} else if (operation == Operation::Write) {
176176
write(boost::get<IcData>(data));
@@ -204,8 +204,10 @@ std::string Ic::writeSequence(std::vector<std::pair<Operation, Data>> ops, bool
204204
for (const auto& it : out) {
205205
Operation operation = it.first;
206206
Data data = it.second;
207-
if (operation == Operation::Read || operation == Operation::Write) {
207+
if (operation == Operation::Read) {
208208
resultBuffer << Util::formatValue(boost::get<IcOut>(data)) << "\n";
209+
} else if (operation == Operation::Write) {
210+
resultBuffer << Util::formatValue(boost::get<IcData>(data).data) << "\n";
209211
} else if (operation == Operation::Error) {
210212
std::string errMessage = boost::get<std::string>(data);
211213
resultBuffer << errMessage;

0 commit comments

Comments
 (0)