Skip to content

Commit

Permalink
Fix index variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sonndinh committed Apr 15, 2024
1 parent 5c8dd05 commit 19ee273
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dds/idl/value_reader_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ namespace {
indent << "if (!value_reader.end_array()) return false;\n";

} else {
generate_read(expression, "", "elem", array->base_type(), idx + "i", level, nested(filter_kind));
generate_read(expression, "", "elem", array->base_type(), idx, level, nested(filter_kind));
}
}
}
Expand All @@ -120,7 +120,7 @@ namespace {
be_global->impl_ << indent << " " << expression << ".resize(" << expression << ".size() + 1);\n";
} else {
if (!sequence->unbounded()) {
be_global->impl_ << indent << " if (i >= " << expression << ".maximum()) return false;\n";
be_global->impl_ << indent << " if (" << idx << " >= " << expression << ".maximum()) return false;\n";
be_global->impl_ << indent << " const ACE_CDR::ULong len = " << expression << ".length();\n";
be_global->impl_ << indent << " " << expression << ".length(len + 1);\n";
} else {
Expand Down

0 comments on commit 19ee273

Please sign in to comment.