aboutsummaryrefslogtreecommitdiff
path: root/src/asm.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-04-02 15:15:04 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-04-02 15:15:04 +0300
commita7cb592efa9ec72c4c5e9d3c1e7469203a4b47e2 (patch)
tree5c43cfbde7cad7f1f46366d9b9fedd9c81953f91 /src/asm.c
parent59148d666a78d671198d56caabe7fe4d7fb3fee1 (diff)
downloadqbt-a7cb592efa9ec72c4c5e9d3c1e7469203a4b47e2.tar.gz
qbt-a7cb592efa9ec72c4c5e9d3c1e7469203a4b47e2.zip
add simple unreachability
Diffstat (limited to 'src/asm.c')
-rw-r--r--src/asm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/asm.c b/src/asm.c
index eb0bead..e177c4e 100644
--- a/src/asm.c
+++ b/src/asm.c
@@ -240,10 +240,10 @@ static void output_ret(struct fn *f, FILE *o)
static void output_j(struct blk *b, struct fn *f, FILE *o)
{
/* the jump is directly to a following block, no need to do anything */
- if (!b->to)
+ if (!b->to || b->s1 == b->s2)
return;
- fprintf(o, "j .%s.%lli\n", f->name, (long long int)b->s1->id);
+ fprintf(o, "j .%s.%lli\n", f->name, (long long int)b->s2->id);
}
static void output_branch(struct blk *b, struct fn *f, FILE *o)