mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
75aff6a4a9
Before this commit, DLA's backend often emitted things like:
```c
struct x {
struct y {
int32_t z;
uint8_t padding[4];
} _offset_0;
uint8_t padding[8];
};
```
This is suboptimal, since the fields of y actually can just be inlined
into x, giving:
```c
struct x {
int32_t z;
uint8_t padding[12];
};
```
This behaviour was due to a logic bug carried over from old versions of
the code, and partially extended, but never revisited nor thought
through.
This commit fixes the problem, making the second behaviour the only
thing DLA ever does when updating the model.
Basically, struct fields are copied over field by field, instead of
inserting the bulk struct (y in the example) inside the larger struct to
update (x in the example).