From: Rafael Garcia-Suarez Date: Wed, 21 Oct 2009 17:07:09 +0000 (+0200) Subject: Fix built-in prototype of each, keys, and values X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7c8178a1ff9cacd9d60d7ce9a16d7e59a0bbefff;p=p5sagit%2Fp5-mst-13.2.git Fix built-in prototype of each, keys, and values Since those keywords can now compile to two different ops each, the usual inspection of opflags is not sufficient for perl to return a meaningful prototype. So we hardcode the correct return value for 5.12 : \[@%] --- diff --git a/pp.c b/pp.c index 078db3b..6f56368 100644 --- a/pp.c +++ b/pp.c @@ -422,6 +422,10 @@ PP(pp_prototype) ret = newSVpvs_flags("_;$", SVs_TEMP); goto set; } + if (code == -KEY_keys || code == -KEY_values || code == -KEY_each) { + ret = newSVpvs_flags("\\[@%]", SVs_TEMP); + goto set; + } if (code == -KEY_readpipe) { s = "CORE::backtick"; } diff --git a/t/op/cproto.t b/t/op/cproto.t index cc2426a..af1555f 100644 --- a/t/op/cproto.t +++ b/t/op/cproto.t @@ -57,7 +57,7 @@ delete undef die (@) do undef dump () -each (\%) +each (\[@%]) else undef elsif undef endgrent () @@ -120,7 +120,7 @@ index ($$;$) int (_) ioctl (*$$) join ($@) -keys (\%) +keys (\[@%]) kill (@) last undef lc (_) @@ -252,7 +252,7 @@ untie undef until undef use undef utime (@) -values (\%) +values (\[@%]) vec ($$$) wait () waitpid ($$)