Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita4420c4

Browse files
author
Michael Meskes
committed
Fixed several bugs concerning indicators and added error messages instead of segfaults.
1 parenteda5126 commita4420c4

File tree

5 files changed

+103
-99
lines changed

5 files changed

+103
-99
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,5 +1170,10 @@ Thu Dec 6 14:02:56 CET 2001
11701170
Sat Dec 8 21:35:45 CET 2001
11711171

11721172
- Fix ecpg to allow pointer to structs.
1173+
1174+
Sun Dec 9 16:21:30 CET 2001
1175+
1176+
- Fixed several bugs concerning indicators and added error messages
1177+
instead of segfaults.
11731178
- Set ecpg version to 2.9.0.
11741179
- Set library version to 3.3.0.

‎src/interfaces/ecpg/preproc/extern.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ extern intyylex(void);
5555
externvoidyyerror(char*);
5656
externvoid*mm_alloc(size_t),*mm_realloc(void*,size_t);
5757
externchar*mm_strdup(constchar*);
58-
externvoidmmerror(enumerrortype,char*);
58+
externvoidmmerror(int,enumerrortype,char*);
5959
externScanKeyword*ScanECPGKeywordLookup(char*);
6060
externScanKeyword*ScanCKeywordLookup(char*);
6161
externvoidoutput_get_descr_header(char*);
@@ -85,3 +85,5 @@ extern ScanKeyword *ScanKeywordLookup(char *text);
8585
#definePARSE_ERROR3
8686
#defineINDICATOR_NOT_ARRAY 4
8787
#defineOUT_OF_MEMORY5
88+
#defineINDICATOR_NOT_STRUCT6
89+
#defineINDICATOR_NOT_SIMPLE7

‎src/interfaces/ecpg/preproc/pgc.l

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.81 2001/09/19 14:09:32 meskes Exp $
15+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.82 2001/12/09 15:27:49 meskes Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -306,7 +306,7 @@ cppline{space}*#(.*\\{line_end})*.*
306306
<xc>{xcinside}{ ECHO; }
307307
<xc>{op_chars} { ECHO; }
308308

309-
<xc><<EOF>> {mmerror(ET_ERROR,"Unterminated /* comment"); }
309+
<xc><<EOF>> {mmerror(PARSE_ERROR,ET_ERROR,"Unterminated /* comment"); }
310310

311311
<SQL>{xbitstart}{
312312
BEGIN(xbit);
@@ -315,7 +315,7 @@ cppline{space}*#(.*\\{line_end})*.*
315315
<xbit>{xbitstop}{
316316
BEGIN(SQL);
317317
if (literalbuf[strspn(literalbuf,"01") +1] !='\0')
318-
mmerror(ET_ERROR,"invalid bit string input.");
318+
mmerror(PARSE_ERROR,ET_ERROR,"invalid bit string input.");
319319
yylval.str = literalbuf;
320320
return BITCONST;
321321
}
@@ -328,7 +328,7 @@ cppline{space}*#(.*\\{line_end})*.*
328328
<xbit>{xbitcat}{
329329
/* ignore */
330330
}
331-
<xbit><<EOF>>{mmerror(ET_ERROR,"Unterminated bit string"); }
331+
<xbit><<EOF>>{mmerror(PARSE_ERROR,ET_ERROR,"Unterminated bit string"); }
332332

333333
<SQL>{xhstart}{
334334
BEGIN(xh);
@@ -347,12 +347,12 @@ cppline{space}*#(.*\\{line_end})*.*
347347
|| val != (long) ((int32) val)
348348
#endif
349349
)
350-
mmerror(ET_ERROR,"Bad hexadecimal integer input");
350+
mmerror(PARSE_ERROR,ET_ERROR,"Bad hexadecimal integer input");
351351
yylval.ival = val;
352352
return ICONST;
353353
}
354354

355-
<xh><<EOF>>{mmerror(ET_ERROR,"Unterminated hexadecimal integer"); }
355+
<xh><<EOF>>{mmerror(PARSE_ERROR,ET_ERROR,"Unterminated hexadecimal integer"); }
356356

357357
{xqstart}{
358358
state_before = YYSTATE;
@@ -373,7 +373,7 @@ cppline{space}*#(.*\\{line_end})*.*
373373
/* ignore */
374374
}
375375

376-
<xq><<EOF>> {mmerror(ET_ERROR,"Unterminated quoted string"); }
376+
<xq><<EOF>> {mmerror(PARSE_ERROR,ET_ERROR,"Unterminated quoted string"); }
377377

378378
<SQL>{xdstart}{
379379
state_before = YYSTATE;
@@ -396,7 +396,7 @@ cppline{space}*#(.*\\{line_end})*.*
396396
literalbuf, NAMEDATALEN-1, literalbuf);
397397
literalbuf[NAMEDATALEN-1] ='\0';
398398
#endif
399-
mmerror(ET_NOTICE, errortext);
399+
mmerror(PARSE_ERROR,ET_NOTICE, errortext);
400400
}
401401

402402
yylval.str =mm_strdup(literalbuf);
@@ -413,7 +413,7 @@ cppline{space}*#(.*\\{line_end})*.*
413413
<xd>{xdinside}{
414414
addlit(yytext, yyleng);
415415
}
416-
<xd,xdc><<EOF>> {mmerror(ET_ERROR,"Unterminated quoted identifier"); }
416+
<xd,xdc><<EOF>> {mmerror(PARSE_ERROR,ET_ERROR,"Unterminated quoted identifier"); }
417417
{xdstart}{
418418
state_before = YYSTATE;
419419
BEGIN(xdc);
@@ -687,10 +687,10 @@ cppline{space}*#(.*\\{line_end})*.*
687687

688688
<C,xskip>{exec_sql}{elif}{space_or_nl}*{/* pop stack */
689689
if ( preproc_tos ==0 ) {
690-
mmerror(ET_FATAL,"Missing matching 'EXEC SQL IFDEF / EXEC SQL IFNDEF'");
690+
mmerror(PARSE_ERROR,ET_FATAL,"Missing matching 'EXEC SQL IFDEF / EXEC SQL IFNDEF'");
691691
}
692692
elseif ( stacked_if_value[preproc_tos].else_branch ) {
693-
mmerror(ET_FATAL,"Missing 'EXEC SQL ENDIF;'");
693+
mmerror(PARSE_ERROR,ET_FATAL,"Missing 'EXEC SQL ENDIF;'");
694694
}
695695
else {
696696
preproc_tos--;
@@ -701,7 +701,7 @@ cppline{space}*#(.*\\{line_end})*.*
701701

702702
<C,xskip>{exec_sql}{else}{space_or_nl}*";" {/* only exec sql endif pops the stack, so take care of duplicated 'else' */
703703
if ( stacked_if_value[preproc_tos].else_branch ) {
704-
mmerror(ET_FATAL,"Duplicated 'EXEC SQL ELSE;'");
704+
mmerror(PARSE_ERROR,ET_FATAL,"Duplicated 'EXEC SQL ELSE;'");
705705
}
706706
else {
707707
stacked_if_value[preproc_tos].else_branch =TRUE;
@@ -719,7 +719,7 @@ cppline{space}*#(.*\\{line_end})*.*
719719
}
720720
<C,xskip>{exec_sql}{endif}{space_or_nl}*";" {
721721
if ( preproc_tos ==0 ) {
722-
mmerror(ET_FATAL,"Unmatched 'EXEC SQL ENDIF;'");
722+
mmerror(PARSE_ERROR,ET_FATAL,"Unmatched 'EXEC SQL ENDIF;'");
723723
}
724724
else {
725725
preproc_tos--;
@@ -737,7 +737,7 @@ cppline{space}*#(.*\\{line_end})*.*
737737

738738
<xcond>{identifier}{space_or_nl}*";" {
739739
if ( preproc_tos >= MAX_NESTED_IF-1 ) {
740-
mmerror(ET_FATAL,"Too many nested 'EXEC SQL IFDEF' conditions");
740+
mmerror(PARSE_ERROR,ET_FATAL,"Too many nested 'EXEC SQL IFDEF' conditions");
741741
}
742742
else {
743743
struct_defines *defptr;
@@ -864,7 +864,7 @@ cppline{space}*#(.*\\{line_end})*.*
864864
if ( preproc_tos >0 ) {
865865
preproc_tos =0;
866866

867-
mmerror(ET_FATAL,"Missing 'EXEC SQL ENDIF;'");
867+
mmerror(PARSE_ERROR,ET_FATAL,"Missing 'EXEC SQL ENDIF;'");
868868
}
869869

870870
if (yy_buffer ==NULL)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp