2000-11-26 21:00 UTC+0800 Ron Pinkas <ron@profit-master.com>

* include/hberrors.h
   * source/pp/ppcomp.c
   * source/pp/ppcore.c
     + Added error support for Input buffer overflow .
This commit is contained in:
Ron Pinkas
2000-11-27 05:13:00 +00:00
parent 96cd0348b4
commit 8a712df3c5
5 changed files with 20 additions and 4 deletions

View File

@@ -1,3 +1,9 @@
2000-11-26 21:00 UTC+0800 Ron Pinkas <ron@profit-master.com>
* include/hberrors.h
* source/pp/ppcomp.c
* source/pp/ppcore.c
+ Added error support for Input buffer overflow .
2000-11-26 18:40 UTC+0800 Ron Pinkas <ron@profit-master.com>
* source/compiler/harbour.slx
+ Added Error message if NUMERALS_PER_LINE is exhausted, and set it to 3000 (just below apparent parser limitation)

View File

@@ -143,6 +143,7 @@ extern "C" {
#define HB_PP_ERR_CANNOT_OPEN_RULES 15
#define HB_PP_ERR_BAD_RULES_FILE_NAME 16
#define HB_PP_ERR_TOO_MANY_INCLUDES 17
#define HB_PP_ERR_BUFFER_OVERFLOW 18
#define HB_PP_WARN_DEFINE_REDEF 1
#define HB_PP_WARN_NO_DIRECTIVES 2

View File

@@ -509,7 +509,7 @@ int hb_comp_SLX_InterceptAction( int iRet, char *sToken )
else if( iRet == REJECT_OP )
{ yylval.string = hb_compIdentifierNew( (char*) sToken, TRUE ); iRet = IDENTIFIER; }
else
{ printf( "Error SLX0001 Missing handler for %i\n", iRet ); hb_comp_iErrorCount++; }
{ printf( "Error SLX0001 Missing handler for '%i' line: %i\n", iRet, hb_comp_iLine - 1 ); hb_comp_iErrorCount++; }
}
#ifdef SHOW_LEX_TOKENS
@@ -641,7 +641,7 @@ static int hb_comp_SLX_ElementToken( char* szToken, unsigned int iTokenLen )
}
else
{
printf( "Error SLX0002 Too many numerals in line %i\n", hb_comp_iLine );
printf( "Error SLX0002 Too many numerals in line: %i\n", hb_comp_iLine - 1 );
hb_comp_iErrorCount++;
iTexts = 0;
}

View File

@@ -81,6 +81,11 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
lens += rdlen;
hb_comp_iLine ++;
if( lens >= HB_PP_STR_SIZE )
{
hb_compGenError( hb_pp_szErrors, 'F', HB_PP_ERR_BUFFER_OVERFLOW, NULL, NULL );
}
if( s_szLine[ lens - 1 ] == ';' )
{
lContinue = 1;
@@ -209,7 +214,10 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
if( handl_o )
hb_pp_WrStr( handl_o, sOut );
// printf( "%d : %s\n",hb_comp_iLine,sOut );
#if 0
printf( "%d : %s\n", hb_comp_iLine, sOut );
#endif
return lens;
}

View File

@@ -179,7 +179,8 @@ char * hb_pp_szErrors[] =
"Value out of range in #pragma directive",
"Can\'t open command definitions file: \'%s\'",
"Invalid command definitions file name: \'%s\'",
"Too many nested #includes, can\'t open: \'%s\'"
"Too many nested #includes, can\'t open: \'%s\'",
"Input buffer overflow"
};
/* Table with warnings */