diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-08-22 14:52:46 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2014-08-22 15:18:49 -0400 |
commit | 9ff909cfc2bd7949d8ac29824e865f43be5c444c (patch) | |
tree | 0a4acc5e33b5a1370d158751d040068f1e26cc98 /toke.c | |
parent | 1b9a108c3fb045814d05d8ad470bbbceec7c8543 (diff) | |
download | perl-9ff909cfc2bd7949d8ac29824e865f43be5c444c.tar.gz |
Fix the PEEK_INFNAN (wrong macro arg name).
Also rename as INFNAN_PEEK, to match HEXFP_PEEK.
Add "send" pointer to INFNAN_PEEK to guard againt past-the-buffer peeking.
HEXFP_PEEK doesn't easily lend itself to "send" pointer
because of it's calling environment doesn't have one.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -114,6 +114,11 @@ static const char* const ident_too_long = "Identifier too long"; #define SPACE_OR_TAB(c) isBLANK_A(c) +#define HEXFP_PEEK(s) \ + (((s[0] == '.') && \ + (isXDIGIT(s[1]) || isALPHA_FOLD_EQ(s[1], 'p'))) || \ + isALPHA_FOLD_EQ(s[0], 'p')) + /* LEX_* are values for PL_lex_state, the state of the lexer. * They are arranged oddly so that the guard on the switch statement * can get by with a single comparison (if the compiler is smart enough). @@ -9980,10 +9985,6 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) /* this could be hexfp, but peek ahead * to avoid matching ".." */ -#define HEXFP_PEEK(s) \ - (((s[0] == '.') && \ - (isXDIGIT(s[1]) || isALPHA_FOLD_EQ(s[1], 'p'))) \ - || isALPHA_FOLD_EQ(s[0], 'p')) if (UNLIKELY(HEXFP_PEEK(s))) { goto out; } |