summaryrefslogtreecommitdiff
path: root/upbc/message_layout.cc
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2018-12-15 16:17:48 -0800
committerJoshua Haberman <jhaberman@gmail.com>2018-12-15 16:17:48 -0800
commit380558922b661499f4eb43b0463b5a73e5fe87b7 (patch)
treea4784816965ae37e72bde3983c68738d7b0d41a4 /upbc/message_layout.cc
parent2681a17513be312d1da924a1644f040eb8c1372a (diff)
test_encoder passes! Other tests still need to be fixed.
Diffstat (limited to 'upbc/message_layout.cc')
-rw-r--r--upbc/message_layout.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/upbc/message_layout.cc b/upbc/message_layout.cc
index 5956424..f0a6872 100644
--- a/upbc/message_layout.cc
+++ b/upbc/message_layout.cc
@@ -130,7 +130,9 @@ void MessageLayout::PlaceNonOneofFields(
int hasbit_count = 0;
for (auto field : field_order) {
if (HasHasbit(field)) {
- hasbit_indexes_[field] = hasbit_count++;
+ // We don't use hasbit 0, so that 0 can indicate "no presence" in the
+ // table. This wastes one hasbit, but we don't worry about it for now.
+ hasbit_indexes_[field] = ++hasbit_count;
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback