mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 23:52:22 +00:00
7701393bd4
If the final block ends in a conditional statement, appending return to the block will hide the conditional statement from the flow analyzer. This may cause the conditional statement's destination node be become unreachable according to the analyzer and thus eliminated. The label for the branch then loses its target sblock and thus the code generator will produce a zero-distance jump resulting in an infinite loop. Thus, if the final block ends in a conditional statement (or, for completeness, a call statement), append a new empty block before adding the return statement.
17 lines
115 B
R
17 lines
115 B
R
void bar ()
|
|
{
|
|
}
|
|
|
|
void foo ()
|
|
{
|
|
int i;
|
|
|
|
for (i = 0; i < 11; i++)
|
|
bar ();
|
|
}
|
|
|
|
int main ()
|
|
{
|
|
foo ();
|
|
return 0;
|
|
}
|