Skip to content

Commit

Permalink
more window fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaileychess committed Apr 29, 2023
1 parent aeba096 commit dbce69c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/binary_annotator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static BinaryRegion MakeBinaryRegion(
const uint64_t offset = 0, const uint64_t length = 0,
const BinaryRegionType type = BinaryRegionType::Unknown,
const uint64_t array_length = 0, const uint64_t points_to_offset = 0,
const BinaryRegionComment comment = {}) {
BinaryRegionComment comment = {}) {
BinaryRegion region;
region.offset = offset;
region.length = length;
Expand All @@ -39,7 +39,7 @@ static BinaryRegion MakeBinaryRegion(

static BinarySection MakeBinarySection(
const std::string &name, const BinarySectionType type,
const std::vector<BinaryRegion> regions) {
std::vector<BinaryRegion> regions) {
BinarySection section;
section.name = name;
section.type = type;
Expand Down
2 changes: 1 addition & 1 deletion src/binary_annotator.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class BinaryAnnotator {
uint16_t offset_from_table = 0;
};

const reflection::Object *referring_table;
const reflection::Object *referring_table = nullptr;

// Field ID -> {field def, offset from table}
std::map<uint16_t, Entry> fields;
Expand Down
8 changes: 5 additions & 3 deletions src/reflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,9 @@ class ResizeContext {
// Recurse.
switch (base_type) {
case reflection::Obj: {
ResizeTable(*subobjectdef, reinterpret_cast<Table *>(ref));
if (subobjectdef) {
ResizeTable(*subobjectdef, reinterpret_cast<Table *>(ref));
}
break;
}
case reflection::Vector: {
Expand Down Expand Up @@ -564,7 +566,7 @@ void SetString(const reflection::Schema &schema, const std::string &val,
// Clear the old string, since we don't want parts of it remaining.
memset(flatbuf->data() + start, 0, str->size());
// Different size, we must expand (or contract).
ResizeContext(schema, start, delta, flatbuf, root_table);
ResizeContext ctx(schema, start, delta, flatbuf, root_table);
// Set the new length.
WriteScalar(flatbuf->data() + str_start,
static_cast<uoffset_t>(val.size()));
Expand All @@ -590,7 +592,7 @@ uint8_t *ResizeAnyVector(const reflection::Schema &schema, uoffset_t newsize,
auto size_clear = -delta_elem * elem_size;
memset(flatbuf->data() + start - size_clear, 0, size_clear);
}
ResizeContext(schema, start, delta_bytes, flatbuf, root_table);
ResizeContext ctx(schema, start, delta_bytes, flatbuf, root_table);
WriteScalar(flatbuf->data() + vec_start, newsize); // Length field.
// Set new elements to 0.. this can be overwritten by the caller.
if (delta_elem > 0) {
Expand Down

0 comments on commit dbce69c

Please sign in to comment.