mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Remove gotos that go to the following statement.
eg: goto foo: foo: //some code
This commit is contained in:
parent
738fc65e0f
commit
f4604d9db5
1 changed files with 9 additions and 0 deletions
|
@ -1224,6 +1224,15 @@ thread_jumps (sblock_t *blocks)
|
|||
l->used++;
|
||||
*label = l;
|
||||
}
|
||||
if (is_goto (s) && (*label)->dest == sblock->next) {
|
||||
statement_t **p;
|
||||
unuse_label (*label);
|
||||
for (p = &sblock->statements; *p != s; p = &(*p)->next)
|
||||
;
|
||||
free_statement (s);
|
||||
*p = 0;
|
||||
sblock->tail = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue