fixed bug #
1692042: input buffer overflow...scanner uses REJECT
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4731
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2007-04-01 Borut Razem <borut.razem AT siol.net>
+
+ * src/SDCC.lex, sdc/SDCCmain.c, support/cpp2/sdcpp.c:
+ fixed bug #1692042: input buffer overflow...scanner uses REJECT
+
2007-03-30 Raphael Neider <rneider AT web.de>
* src/pic/ralloc.c (isData): suppress garbage debug output
2007-03-30 Raphael Neider <rneider AT web.de>
* src/pic/ralloc.c (isData): suppress garbage debug output
-------------------------------------------------------------------------*/
D [0-9]
-------------------------------------------------------------------------*/
D [0-9]
-L [a-zA-Z_]
-L_DOLL [a-zA-Z_$]
H [a-fA-F0-9]
E [Ee][+-]?{D}+
FS (f|F|l|L)
H [a-fA-F0-9]
E [Ee][+-]?{D}+
FS (f|F|l|L)
static struct dbuf_s asmbuff; /* reusable _asm buffer */
/* forward declarations */
static struct dbuf_s asmbuff; /* reusable _asm buffer */
/* forward declarations */
static const char *stringLiteral(void);
static void count(void);
static void count_char(int);
static const char *stringLiteral(void);
static void count(void);
static void count_char(int);
"__overlay" { count(); TKEYWORD(OVERLAY); }
"inline" { count(); TKEYWORD99(INLINE); }
"restrict" { count(); TKEYWORD99(RESTRICT); }
"__overlay" { count(); TKEYWORD(OVERLAY); }
"inline" { count(); TKEYWORD99(INLINE); }
"restrict" { count(); TKEYWORD99(RESTRICT); }
-{L}({L}|{D})* { count(); return(check_type()); }
-{L_DOLL}({L_DOLL}|{D})* {
- if (options.dollars_in_ident)
+{L}({L}|{D})* {
+ if (!options.dollars_in_ident && strchr(yytext, '$'))
- count();
- return(check_type());
+ yyerror("stray '$' in program");
+ count();
+ return(check_type());
}
0[xX]{H}+{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); }
0[0-7]*{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); }
}
0[xX]{H}+{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); }
0[0-7]*{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); }
/* if using dollar signs in identifiers */
if (options.dollars_in_ident)
/* if using dollar signs in identifiers */
if (options.dollars_in_ident)
- addSet(&preArgvSet, Safe_strdup("--fdollars-in-identifiers"));
+ addSet(&preArgvSet, Safe_strdup("-fdollars-in-identifiers"));
/* if using external stack define the macro */
if (options.useXstack)
/* if using external stack define the macro */
if (options.useXstack)
va_start (ap, gmsgid);
fprintf (stderr, "%s: note: ", progname);
vfprintf (stderr, gmsgid, ap);
va_start (ap, gmsgid);
fprintf (stderr, "%s: note: ", progname);
vfprintf (stderr, gmsgid, ap);
va_start (ap, gmsgid);
fprintf (stderr, "%s: warning: ", progname);
vfprintf (stderr, gmsgid, ap);
va_start (ap, gmsgid);
fprintf (stderr, "%s: warning: ", progname);
vfprintf (stderr, gmsgid, ap);
va_start (ap, gmsgid);
fprintf (stderr, "%s: error: ", progname);
vfprintf (stderr, gmsgid, ap);
va_start (ap, gmsgid);
fprintf (stderr, "%s: error: ", progname);
vfprintf (stderr, gmsgid, ap);
va_start (ap, gmsgid);
fprintf (stderr, "%s: fatal error: ", progname);
vfprintf (stderr, gmsgid, ap);
va_start (ap, gmsgid);
fprintf (stderr, "%s: fatal error: ", progname);
vfprintf (stderr, gmsgid, ap);
va_end (ap);
gcc_unreachable ();
va_end (ap);
gcc_unreachable ();
va_start (ap, gmsgid);
fprintf (stderr, "%s: internal compiler error: ", progname);
vfprintf (stderr, gmsgid, ap);
va_start (ap, gmsgid);
fprintf (stderr, "%s: internal compiler error: ", progname);
vfprintf (stderr, gmsgid, ap);
va_end (ap);
gcc_unreachable ();
va_end (ap);
gcc_unreachable ();