Print this page
new smatch

*** 72,92 **** bb, bb->pos.line, bb->pos.line, bb->pos.pos); /* List loads and stores */ FOR_EACH_PTR(bb->insns, insn) { switch(insn->opcode) { case OP_STORE: ! if (insn->symbol->type == PSEUDO_SYM) { ! printf("%s store(%s)", s, show_ident(insn->symbol->sym->ident)); s = ","; } break; case OP_LOAD: ! if (insn->symbol->type == PSEUDO_SYM) { ! printf("%s load(%s)", s, show_ident(insn->symbol->sym->ident)); s = ","; } break; case OP_RET: --- 72,94 ---- bb, bb->pos.line, bb->pos.line, bb->pos.pos); /* List loads and stores */ FOR_EACH_PTR(bb->insns, insn) { + if (!insn->bb) + continue; switch(insn->opcode) { case OP_STORE: ! if (insn->src->type == PSEUDO_SYM) { ! printf("%s store(%s)", s, show_ident(insn->src->sym->ident)); s = ","; } break; case OP_LOAD: ! if (insn->src->type == PSEUDO_SYM) { ! printf("%s load(%s)", s, show_ident(insn->src->sym->ident)); s = ","; } break; case OP_RET:
*** 128,137 **** --- 130,141 ---- continue; if (!bb->parents && !bb->children && !bb->insns && verbose < 2) continue; FOR_EACH_PTR(bb->insns, insn) { + if (!insn->bb) + continue; if (insn->opcode == OP_CALL && internal == !(insn->func->sym->ctype.modifiers & MOD_EXTERN)) { /* Find the symbol for the callee's definition */ struct symbol * sym;
*** 170,180 **** fsyms = sparse_initialize(argc, argv, &filelist); concat_symbol_list(fsyms, &all_syms); /* Linearize all symbols, graph internal basic block * structures and intra-file calls */ ! FOR_EACH_PTR_NOTAG(filelist, file) { fsyms = sparse(file); concat_symbol_list(fsyms, &all_syms); FOR_EACH_PTR(fsyms, sym) { --- 174,184 ---- fsyms = sparse_initialize(argc, argv, &filelist); concat_symbol_list(fsyms, &all_syms); /* Linearize all symbols, graph internal basic block * structures and intra-file calls */ ! FOR_EACH_PTR(filelist, file) { fsyms = sparse(file); concat_symbol_list(fsyms, &all_syms); FOR_EACH_PTR(fsyms, sym) {
*** 185,202 **** FOR_EACH_PTR(fsyms, sym) { if (sym->ep) { graph_ep(sym->ep); graph_calls(sym->ep, 1); } ! } END_FOR_EACH_PTR_NOTAG(sym); ! } END_FOR_EACH_PTR_NOTAG(file); /* Graph inter-file calls */ FOR_EACH_PTR(all_syms, sym) { if (sym->ep) graph_calls(sym->ep, 0); ! } END_FOR_EACH_PTR_NOTAG(sym); printf("}\n"); return 0; } --- 189,206 ---- FOR_EACH_PTR(fsyms, sym) { if (sym->ep) { graph_ep(sym->ep); graph_calls(sym->ep, 1); } ! } END_FOR_EACH_PTR(sym); ! } END_FOR_EACH_PTR(file); /* Graph inter-file calls */ FOR_EACH_PTR(all_syms, sym) { if (sym->ep) graph_calls(sym->ep, 0); ! } END_FOR_EACH_PTR(sym); printf("}\n"); return 0; }