fixed switch statements with only one case statement

SVN revision: 13517
This commit is contained in:
tsauerbeck 2005-02-26 14:46:07 +00:00 committed by tsauerbeck
parent c6d34bc399
commit c748aecba1
1 changed files with 8 additions and 2 deletions

View File

@ -3859,9 +3859,15 @@ doswitch(void)
* occur; there really shouldn't be duplicate cases, but the compiler
* may not crash or drop into an assertion for a user error). */
for (cse = caselist.next; cse != NULL && cse->next != NULL; cse = cse->next)
; /* empty. no idea whether this is correct, but we MUST NOT do
* the setlabel(lbl_table) call in the loop body. doing so breaks
* switch statements that only have one case statement following.
*/
#endif
/* generate the table here, before lbl_exit (general jump target) */
setlabel(lbl_table);
/* generate the table here, before lbl_exit (general jump target) */
setlabel(lbl_table);
if (swdefault == FALSE)
{
/* store lbl_exit as the "none-matched" label in the switch table */