summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-03-05 05:14:40 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-03-05 05:14:40 +0000
commitcaafccfc6154ab62c6fdc615945c7e9b5a33f298 (patch)
treea368ebfd98124532fee37d6d872e04f953270629 /toke.c
parentc239479b528987a0d52e5c90057dd2ab5c0ca9c3 (diff)
parent5a89daa8ec9b19ce15af46edf1370e5e0067ec4e (diff)
downloadperl-caafccfc6154ab62c6fdc615945c7e9b5a33f298.tar.gz
Integrate with Sarathy.
p4raw-id: //depot/cfgperl@5535
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/toke.c b/toke.c
index 5b2fc9899c..194766caa4 100644
--- a/toke.c
+++ b/toke.c
@@ -5640,7 +5640,7 @@ S_checkcomma(pTHX_ register char *s, char *name, char *what)
STATIC SV *
S_new_constant(pTHX_ char *s, STRLEN len, const char *key, SV *sv, SV *pv,
- const char *type)
+ const char *type)
{
dSP;
HV *table = GvHV(PL_hintgv); /* ^H */
@@ -5700,8 +5700,7 @@ S_new_constant(pTHX_ char *s, STRLEN len, const char *key, SV *sv, SV *pv,
SPAGAIN ;
/* Check the eval first */
- if (!PL_in_eval && SvTRUE(ERRSV))
- {
+ if (!PL_in_eval && SvTRUE(ERRSV)) {
STRLEN n_a;
sv_catpv(ERRSV, "Propagated");
yyerror(SvPV(ERRSV, n_a)); /* Duplicates the message inside eval */
@@ -5724,9 +5723,9 @@ S_new_constant(pTHX_ char *s, STRLEN len, const char *key, SV *sv, SV *pv,
why2 = key;
sv = res;
goto report;
- }
+ }
- return res;
+ return res;
}
STATIC char *
@@ -6684,11 +6683,12 @@ Perl_scan_num(pTHX_ char *start)
register char *s = start; /* current position in buffer */
register char *d; /* destination in temp buffer */
register char *e; /* end of temp buffer */
+ IV tryiv; /* used to see if it can be an IV */
+ UV tryuv; /* used to see if it can be an UV */
#if ( defined(USE_64_BIT_INT) && \
(!defined(HAS_STRTOLL)|| !defined(HAS_STRTOULL))) || \
(!defined(USE_64_BIT_INT) && \
(!defined(HAS_STRTOL) || !defined(HAS_STRTOUL)))
- IV tryiv; /* used to see if it can be an IV */
#endif
NV value; /* number read, as a double */
SV *sv = Nullsv; /* place to put the converted number */
@@ -6969,9 +6969,13 @@ Perl_scan_num(pTHX_ char *start)
Note: if floatit is true, then we don't need to do the
conversion at all.
*/
- tryiv = I_V(value);
- if (!floatit && (NV)tryiv == value)
- sv_setiv(sv, tryiv);
+ tryuv = U_V(value);
+ if (!floatit && (NV)tryuv == value) {
+ if (tryuv <= IV_MAX)
+ sv_setiv(sv, (IV)tryuv);
+ else
+ sv_setuv(sv, tryuv);
+ }
else
sv_setnv(sv, value);
#else