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

Commite6851f0

Browse files
author
Michael Meskes
committed
Synced pgc.l with scan.l.
1 parentba8b844 commite6851f0

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,8 +1060,12 @@ Mon Feb 26 15:22:04 CET 2001
10601060

10611061
- Fixed misplaced variables FoundInto and QueryIsRule.
10621062

1063-
Don Mar 29 10:23:05 CEST 2001
1063+
Thu Mar 29 10:23:05 CEST 2001
10641064

10651065
- Applied bug fix in ecpgtype.h by Adriaan Joubert.
1066+
1067+
Mon Apr 2 10:16:10 CEST 2001
1068+
1069+
- Synced scan.l and pgc.l.
10661070
- Set ecpg version to 2.8.0.
10671071
- Set library version to 3.2.0.

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

Lines changed: 19 additions & 5 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.77 2001/02/21 18:53:47 tgl Exp $
15+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.78 2001/04/02 08:17:24 meskes Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -335,13 +335,20 @@ cppline{space}*#(.*\\{line_end})*.*
335335
startlit();
336336
}
337337
<xh>{xhstop}{
338+
long val;
338339
char* endptr;
339340

340341
BEGIN(SQL);
341342
errno =0;
342-
yylval.ival =strtol(literalbuf, &endptr,16);
343-
if (*endptr !='\0' || errno == ERANGE)
343+
val =strtol(literalbuf, &endptr,16);
344+
if (*endptr !='\0' || errno == ERANGE
345+
#ifdef HAVE_LONG_INT_64
346+
/* if long > 32 bits, check for overflow of int4 */
347+
|| val != (long) ((int32) val)
348+
#endif
349+
)
344350
mmerror(ET_ERROR,"Bad hexadecimal integer input");
351+
yylval.ival = val;
345352
return ICONST;
346353
}
347354

@@ -498,16 +505,23 @@ cppline{space}*#(.*\\{line_end})*.*
498505
return PARAM;
499506
}
500507
<C,SQL>{integer}{
508+
long val;
501509
char* endptr;
502510

503511
errno =0;
504-
yylval.ival =strtol((char *)yytext, &endptr,10);
505-
if (*endptr !='\0' || errno == ERANGE)
512+
val =strtol((char *)yytext, &endptr,10);
513+
if (*endptr !='\0' || errno == ERANGE
514+
#ifdef HAVE_LONG_INT_64
515+
/* if long > 32 bits, check for overflow of int4 */
516+
|| val != (long) ((int32) val)
517+
#endif
518+
)
506519
{
507520
errno =0;
508521
yylval.str =mm_strdup((char*)yytext);
509522
return FCONST;
510523
}
524+
yylval.ival = val;
511525
return ICONST;
512526
}
513527
<SQL>{ip}{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp