summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-06-24 03:47:39 -0500
committerJesse Luehrs <doy@tozt.net>2012-06-24 03:47:39 -0500
commit61a3fb803c3babf0e3e750430415338e6506a241 (patch)
treec8a5f56b6cfb2a4687a02e6b7263cd98a86bb89b /pp.c
parentf914a68295eedf2aa19e258317bc5955132805b4 (diff)
downloadperl-61a3fb803c3babf0e3e750430415338e6506a241.tar.gz
add warning for negative argument to chr() [perl #83048]
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 6936b4f796..1fcc885442 100644
--- a/pp.c
+++ b/pp.c
@@ -3262,7 +3262,8 @@ PP(pp_chr)
if (IN_BYTES) {
value = POPu; /* chr(-1) eq chr(0xff), etc. */
} else {
- (void) POPs; /* Ignore the argument value. */
+ SV *top = POPs;
+ Perl_ck_warner(aTHX_ packWARN(WARN_UTF8), "Invalid negative number (%"SVf") in chr", top);
value = UNICODE_REPLACEMENT;
}
} else {