Skip to content

Commit 933ed40

Browse files
committed
Move the code for handling operator __pragma out of newfunc()
This fixes a bug with `__pragma` being expected twice in certain cases.
1 parent 6fd5904 commit 933ed40

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

source/compiler/sc1.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,10 @@ static void parse(void)
17881788
case tLABEL:
17891789
case tSYMBOL:
17901790
case tOPERATOR:
1791-
lexpush();
1791+
if (tok==t__PRAGMA)
1792+
dopragma();
1793+
else
1794+
lexpush();
17921795
if (!newfunc(NULL,-1,FALSE,FALSE,FALSE)) {
17931796
error(10); /* illegal function or declaration */
17941797
lexclr(TRUE); /* drop the rest of the line */
@@ -3909,10 +3912,6 @@ static int newfunc(char *firstname,int firsttag,int fpublic,int fstatic,int fsto
39093912
tok=lex(&val,&str);
39103913
if (tok==tNATIVE || (tok==tPUBLIC && fstock))
39113914
error(42); /* invalid combination of class specifiers */
3912-
if (tok==t__PRAGMA) {
3913-
dopragma();
3914-
tok=lex(&val,&str);
3915-
} /* if */
39163915
if (tok==tOPERATOR) {
39173916
opertok=operatorname(symbolname);
39183917
if (opertok==0)

0 commit comments

Comments
 (0)