mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-09 21:24:14 +00:00
fix offset in generated code (#129)
This commit is contained in:
parent
feaf0e86ed
commit
c1f672b262
@ -2286,7 +2286,7 @@ bool OICodeGen::generateStructDef(drgn_type* e, std::string& code) {
|
||||
|
||||
structDefinition.append(" ");
|
||||
structDefinition.append(*tmpStr);
|
||||
structDefinition.append("{\n");
|
||||
structDefinition.append(" {\n");
|
||||
if (kind == DRGN_TYPE_UNION) {
|
||||
// Pad out unions
|
||||
structDefinition.append("char union_padding[" + std::to_string(*sz) +
|
||||
@ -2490,8 +2490,8 @@ std::optional<uint64_t> OICodeGen::generateMember(
|
||||
currOffsetBits = 0;
|
||||
VLOG(1) << "Member size: " << memberSize;
|
||||
} else {
|
||||
currOffsetBits = currOffsetBits + memberSize;
|
||||
addSizeComment(config.genPaddingStats, code, currOffsetBits, memberSize);
|
||||
currOffsetBits = currOffsetBits + memberSize;
|
||||
}
|
||||
|
||||
code.append(*tmpStr);
|
||||
|
Loading…
Reference in New Issue
Block a user