aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/graph.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-04-04 06:14:23 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-04-04 07:41:52 +0200
commit34c827db37e98c40f35ff74bcffd3ea21f0cf2b0 (patch)
tree222464d4d4405d470f8e10f5d57a96bdca443397 /graph.c
parent4e67727cdc1209ea374378b4446594576411c3b7 (diff)
downloadsparse-dev-34c827db37e98c40f35ff74bcffd3ea21f0cf2b0.tar.gz
graph: do not use insn->symbol for memops
In struct instruction, OP_LOAD & OP_STORE are defined like unops and so the pseudo holding the address should be 'insn->src'. OTOH, 'insn->symbol' is supposed to be used only for OP_SYMADDR. However, in graph.c, the field 'symbol' is used for OP_LOAD/STORE's address. Now, this doesn't matter much as the field 'src' & 'symbol' are aliased/unioned (together with 'src1', 'cond', ...) but it can be confusing. Change this by using the field 'src' for memops here too. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'graph.c')
-rw-r--r--graph.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/graph.c b/graph.c
index c9af9a58..c83a1c42 100644
--- a/graph.c
+++ b/graph.c
@@ -76,15 +76,15 @@ static void graph_ep(struct entrypoint *ep)
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));
+ if (insn->src->type == PSEUDO_SYM) {
+ printf("%s store(%s)", s, show_ident(insn->src->sym->ident));
s = ",";
}
break;
case OP_LOAD:
- if (insn->symbol->type == PSEUDO_SYM) {
- printf("%s load(%s)", s, show_ident(insn->symbol->sym->ident));
+ if (insn->src->type == PSEUDO_SYM) {
+ printf("%s load(%s)", s, show_ident(insn->src->sym->ident));
s = ",";
}
break;