@@ -91,16 +91,19 @@ strbuf_t *SOURCE;
91
91
hashmap_t * INCLUSION_MAP ;
92
92
93
93
/* ELF sections */
94
- strbuf_t * elf_code , * elf_data ;
94
+ strbuf_t * elf_code ;
95
+ strbuf_t * elf_data ;
95
96
strbuf_t * elf_rodata ;
96
97
strbuf_t * elf_header ;
97
98
strbuf_t * elf_symtab ;
98
99
strbuf_t * elf_strtab ;
99
100
strbuf_t * elf_section ;
100
101
int elf_header_len = 0x54 ; /* ELF fixed: 0x34 + 1 * 0x20 */
101
- int elf_code_start , elf_data_start ;
102
+ int elf_code_start ;
103
+ int elf_data_start ;
102
104
int elf_rodata_start ;
103
- int elf_bss_start , elf_bss_size ;
105
+ int elf_bss_start ;
106
+ int elf_bss_size ;
104
107
105
108
/* Create a new arena block with given capacity.
106
109
* @capacity: The capacity of the arena block. Must be positive.
@@ -347,7 +350,8 @@ bb_traversal_args_t *arena_alloc_traversal_args(void)
347
350
348
351
void arena_free (arena_t * arena )
349
352
{
350
- arena_block_t * block = arena -> head , * next ;
353
+ arena_block_t * block = arena -> head ;
354
+ arena_block_t * next ;
351
355
352
356
while (block ) {
353
357
next = block -> next ;
@@ -472,7 +476,9 @@ void hashmap_rehash(hashmap_t *map)
472
476
}
473
477
474
478
for (int i = 0 ; i < old_cap ; i ++ ) {
475
- hashmap_node_t * cur = old_buckets [i ], * next , * target_cur ;
479
+ hashmap_node_t * cur = old_buckets [i ];
480
+ hashmap_node_t * next ;
481
+ hashmap_node_t * target_cur ;
476
482
477
483
while (cur ) {
478
484
next = cur -> next ;
@@ -1649,6 +1655,10 @@ void dump_insn(void)
1649
1655
printf ("==<START OF INSN DUMP>==\n" );
1650
1656
1651
1657
for (func_t * func = FUNC_LIST .head ; func ; func = func -> next ) {
1658
+ /* Skip function declarations without bodies */
1659
+ if (!func -> bbs )
1660
+ continue ;
1661
+
1652
1662
bool at_func_start = true;
1653
1663
1654
1664
printf ("def %s" , func -> return_def .type -> type_name );
0 commit comments