@@ -91,16 +91,19 @@ strbuf_t *SOURCE;
9191hashmap_t * INCLUSION_MAP ;
9292
9393/* ELF sections */
94- strbuf_t * elf_code , * elf_data ;
94+ strbuf_t * elf_code ;
95+ strbuf_t * elf_data ;
9596strbuf_t * elf_rodata ;
9697strbuf_t * elf_header ;
9798strbuf_t * elf_symtab ;
9899strbuf_t * elf_strtab ;
99100strbuf_t * elf_section ;
100101int 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 ;
102104int elf_rodata_start ;
103- int elf_bss_start , elf_bss_size ;
105+ int elf_bss_start ;
106+ int elf_bss_size ;
104107
105108/* Create a new arena block with given capacity.
106109 * @capacity: The capacity of the arena block. Must be positive.
@@ -347,7 +350,8 @@ bb_traversal_args_t *arena_alloc_traversal_args(void)
347350
348351void arena_free (arena_t * arena )
349352{
350- arena_block_t * block = arena -> head , * next ;
353+ arena_block_t * block = arena -> head ;
354+ arena_block_t * next ;
351355
352356 while (block ) {
353357 next = block -> next ;
@@ -472,7 +476,9 @@ void hashmap_rehash(hashmap_t *map)
472476 }
473477
474478 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 ;
476482
477483 while (cur ) {
478484 next = cur -> next ;
@@ -1649,6 +1655,10 @@ void dump_insn(void)
16491655 printf ("==<START OF INSN DUMP>==\n" );
16501656
16511657 for (func_t * func = FUNC_LIST .head ; func ; func = func -> next ) {
1658+ /* Skip function declarations without bodies */
1659+ if (!func -> bbs )
1660+ continue ;
1661+
16521662 bool at_func_start = true;
16531663
16541664 printf ("def %s" , func -> return_def .type -> type_name );
0 commit comments