History

switch label parse fix

bellard committed 23 years ago

Commit c5ab4521 parent 4149fed1 file · +7 −3Browse files

Unified · Split

tcc.c+7−3
@@ -1,7 +1,7 @@
11 /*
22 * TCC - Tiny C Compiler
33 *
4− * Copyright (c) 2001, 2002 Fabrice Bellard
4+ * Copyright (c) 2001, 2002, 2003 Fabrice Bellard
55 *
66 * This program is free software; you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
@@ -737,6 +737,7 @@ typedef struct ASMOperand { · 729 unmodified lines
737737 int ref_index; /* if >= 0, gives reference to a output constraint */
738738 int priority; /* priority, used to assign registers */
739739 int reg; /* if >= 0, register number used for this operand */
740+ int is_llong; /* true if double register value */
740741 } ASMOperand;
741742
742743 static void asm_expr(TCCState *s1, ExprValue *pe);
@@ -7499,7 +7500,8 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 6756 unmodified lines
74997500 }
75007501 gsym(b);
75017502 skip(':');
7502− block(bsym, csym, case_sym, def_sym, case_reg, 0);
7503+ is_expr = 0;
7504+ goto block_after_label;
75037505 } else
75047506 if (tok == TOK_DEFAULT) {
75057507 next();
@@ -7509,7 +7511,8 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 3 unmodified lines
75097511 if (*def_sym)
75107512 error("too many 'default'");
75117513 *def_sym = ind;
7512− block(bsym, csym, case_sym, def_sym, case_reg, 0);
7514+ is_expr = 0;
7515+ goto block_after_label;
75137516 } else
75147517 if (tok == TOK_GOTO) {
75157518 next();
@@ -7556,6 +7559,7 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 40 unmodified lines
75567559 }
75577560 s->next = (void *)ind;
75587561 /* we accept this, but it is a mistake */
7562+ block_after_label:
75597563 if (tok == '}') {
75607564 warning("deprecated use of label at end of compound statement");
75617565 } else {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t