From 22ff313068aa37b1a24855e760e71ee9a20a1a90 Mon Sep 17 00:00:00 2001 From: Hugo van der Sanden Date: Mon, 23 Feb 2015 16:48:15 +0000 Subject: [perl #123814] replace grok_atou with grok_atoUV Some questions and loose ends: XXX gv.c:S_gv_magicalize - why are we using SSize_t for paren? XXX mg.c:Perl_magic_set - need appopriate error handling for $) XXX regcomp.c:S_reg - need to check if we do the right thing if parno was not grokked Perl_get_debug_opts should probably return something unsigned; not sure if that's something we can change. --- gv.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'gv.c') diff --git a/gv.c b/gv.c index 2eb18e4f39..63bdc569b1 100644 --- a/gv.c +++ b/gv.c @@ -1984,13 +1984,11 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, { /* Ensures that we have an all-digit variable, ${"1foo"} fails this test */ - /* This snippet is taken from is_gv_magical */ - const char *end = name + len; - while (--end > name) { - if (!isDIGIT(*end)) - return addmg; - } - paren = grok_atou(name, NULL); + UV uv; + if (!grok_atoUV(name, &uv, NULL) || uv > I32_MAX) + return addmg; + /* XXX why are we using a SSize_t? */ + paren = (SSize_t)(I32)uv; goto storeparen; } } -- cgit v1.2.1