File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -567,7 +567,6 @@ static const char *implementationString (const impType imp)
567567/*
568568* Debugging functions
569569*/
570- #define DEBUG
571570#ifdef DEBUG
572571
573572#define boolString (c ) ((c) ? "TRUE" : "FALSE")
@@ -2120,6 +2119,7 @@ static void parseReturnType (statementInfo *const st)
21202119{
21212120 int i ;
21222121 int lower_bound ;
2122+ int upper_bound ;
21232123 tokenInfo * finding_tok ;
21242124
21252125 /* FIXME TODO: if java language must be supported then impement this here
@@ -2161,8 +2161,21 @@ static void parseReturnType (statementInfo *const st)
21612161 }
21622162 else
21632163 lower_bound = 1 ;
2164-
2165- for (i = (unsigned int ) NumTokens ; i > lower_bound ; i -- )
2164+
2165+ upper_bound = -1 ;
2166+ for (i = 0 ; i < NumTokens ; i ++ ) {
2167+ tokenInfo * curr_tok ;
2168+ curr_tok = prevToken (st , i );
2169+ if (curr_tok -> type == TOKEN_BRACE_CLOSE || curr_tok -> type == TOKEN_BRACE_OPEN ) {
2170+ upper_bound = i - 1 ;
2171+ break ;
2172+ }
2173+ }
2174+ if (upper_bound < 0 ) {
2175+ upper_bound = NumTokens - 1 ;
2176+ }
2177+
2178+ for (i = upper_bound ; i > lower_bound ; i -- )
21662179 {
21672180 tokenInfo * curr_tok ;
21682181 curr_tok = prevToken (st , i );
You can’t perform that action at this time.
0 commit comments