Skip to content

Commit

Permalink
Fix uninitialized value for 'size'
Browse files Browse the repository at this point in the history
  • Loading branch information
peadar committed Jul 8, 2024
1 parent 145c2c5 commit f775601
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion process.cc
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,14 @@ struct RemoteValue {
buf.resize(sizeof addr_);
memcpy(&buf[0], &addr_, sizeof addr_);
} else {
size_t size;
auto sizeAttr = type.attribute(DW_AT_byte_size);
size_t size;
if (sizeAttr.valid()) {
size = uintmax_t(sizeAttr);
} else if (type.tag() == DW_TAG_reference_type || type.tag() == DW_TAG_pointer_type) {
size = sizeof (void *);
} else {
size = 0;
}
if (!size) {
error = "<no size for type>";
Expand Down

0 comments on commit f775601

Please sign in to comment.