summaryrefslogtreecommitdiff
path: root/assemble.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-09-24 08:21:08 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-09-24 08:21:08 -0400
commit784ff59108b887e246b0f33ff696dfd981659ab2 (patch)
tree02d00ff774bd35a31f04afb62a7f187ca0a097f9 /assemble.c
parent9932fac52c0cac2e9e0e11c84dfdf99e0a87ebfb (diff)
- Fixed some more bugs with struct, and union handling.
Diffstat (limited to 'assemble.c')
-rw-r--r--assemble.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/assemble.c b/assemble.c
index 24037d9..8d7eb85 100644
--- a/assemble.c
+++ b/assemble.c
@@ -192,9 +192,11 @@ uint16_t handle_struct(line **ln, uint64_t address, uint16_t offset, uint8_t dbg
if (member && t->type != DIR_UNION && t->type != DIR_STRUCT) {
member->val = offset;
}
- size += member_size;
if (is_struct) {
+ size += member_size;
offset += member_size;
+ } else if (size < member_size) {
+ size = member_size;
}
}
ismember = 0;
@@ -666,7 +668,7 @@ static void print_symtree(symbol *s, int depth) {
}
}
-static void fix_symtree(line *l) {
+void fix_symtree(line *l) {
symbol *s = symbols;
symbol *cur_sym = NULL;
symbol *sym_struct = NULL;