diff options
author | Tony Cook <tony@develop-help.com> | 2019-07-31 11:06:20 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2019-07-31 11:06:20 +1000 |
commit | 8348ac19a3c37caf807ef0f64320e0bec53b6747 (patch) | |
tree | 5ec5bef633fc816a7a7e0358051eabdd0d4f79fd /toke.c | |
parent | 82007f754ed1e129a53fc7c964d84cddba7ca0de (diff) | |
download | perl-8348ac19a3c37caf807ef0f64320e0bec53b6747.tar.gz |
(perl #134310) don't confuse S_no_op()
This code could previously set PL_bufptr so it points after the
returned s pointer, which S_no_op() asserts on for the test case.
Since setting PL_bufptr here is useful when producing the error
message, just make sure we restore it.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -11342,10 +11342,12 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) behaviour, like for: "0x.3" and "0x+$foo". */ const char *d = s; + char *oldbp = PL_bufptr; if (*d) ++d; /* so the user sees the bad non-digit */ PL_bufptr = (char *)d; /* so yyerror reports the context */ yyerror(Perl_form(aTHX_ "No digits found for %s literal", shift == 4 ? "hexadecimal" : "binary")); + PL_bufptr = oldbp; } if (overflowed) { |