From c748aecba1fc455bab496fb407a5d5fbb6ec7a84 Mon Sep 17 00:00:00 2001 From: tsauerbeck Date: Sat, 26 Feb 2005 14:46:07 +0000 Subject: [PATCH] fixed switch statements with only one case statement SVN revision: 13517 --- legacy/embryo/src/bin/embryo_cc_sc1.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/legacy/embryo/src/bin/embryo_cc_sc1.c b/legacy/embryo/src/bin/embryo_cc_sc1.c index 8d29b1ccd8..fc686dd026 100644 --- a/legacy/embryo/src/bin/embryo_cc_sc1.c +++ b/legacy/embryo/src/bin/embryo_cc_sc1.c @@ -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 */