summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-05 04:30:02 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-05 04:30:02 +0000
commit9b0e499bcdd1e62b4ead7739d3482d056b5ac3dc (patch)
tree1f0b19fb5573092a339abc73c454ee7256f1009f /toke.c
parentd5448623582779336009dd8bafd91e2a4ca7c599 (diff)
downloadperl-9b0e499bcdd1e62b4ead7739d3482d056b5ac3dc.tar.gz
scan_num() sticks to UVs rather than IVs (now -2147483648 doesn't
end up being promoted to an NV) p4raw-id: //depot/perl@5533
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/toke.c b/toke.c
index 79ee972e02..8a2130322b 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,7 +6683,7 @@ 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 */
NV value; /* number read, as a double */
SV *sv = Nullsv; /* place to put the converted number */
bool floatit; /* boolean: int or float? */
@@ -6954,9 +6953,9 @@ 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)
+ sv_setuv(sv, tryuv);
else
sv_setnv(sv, value);
if ( floatit ? (PL_hints & HINT_NEW_FLOAT) :