From: Father Chrysostomos Date: Fri, 12 Aug 2011 05:19:50 +0000 (-0700) Subject: Change (l)stat’s prototype from * to ;* X-Git-Tag: accepted/trunk/20130322.191538~3148^2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=465bc0f5bf04702adf1825f8db8511ecc5c3adfc;p=platform%2Fupstream%2Fperl.git Change (l)stat’s prototype from * to ;* Since the argument is optional, we need a semicolon. This commit accomplishes that by setting the OA_OPTIONAL flag for the appropriate entries in PL_opargs. This should not affect anything else, as ck_ftst (the check routine for [l]stat) doesn’t even look at PL_opargs. It also has to tweak the prototype-generation logic slightly, because PL_opargs also has OA_DEFGV set. I think this is insignificant enough not to warrant a delta entry. --- diff --git a/op.c b/op.c index b42069a..0ab2d1e 100644 --- a/op.c +++ b/op.c @@ -10314,7 +10314,9 @@ Perl_core_prototype(pTHX_ SV *sv, const char *name, const STRLEN len, defgv = PL_opargs[i] & OA_DEFGV; oa = PL_opargs[i] >> OASHIFT; while (oa) { - if (oa & OA_OPTIONAL && !seen_question && (!defgv || n)) { + if (oa & OA_OPTIONAL && !seen_question && ( + !defgv || n || (oa & (OA_OPTIONAL - 1)) == OA_FILEREF + )) { seen_question = 1; str[n++] = ';'; } diff --git a/opcode.h b/opcode.h index fb64ae2..73c81dd 100644 --- a/opcode.h +++ b/opcode.h @@ -1939,8 +1939,8 @@ EXTCONST U32 PL_opargs[] = { 0x01116404, /* ssockopt */ 0x00006b04, /* getsockname */ 0x00006b04, /* getpeername */ - 0x00006c80, /* lstat */ - 0x00006c80, /* stat */ + 0x0000ec80, /* lstat */ + 0x0000ec80, /* stat */ 0x00006c84, /* ftrread */ 0x00006c84, /* ftrwrite */ 0x00006c84, /* ftrexec */ diff --git a/regen/opcodes b/regen/opcodes index 2611111..ec9c5a7 100644 --- a/regen/opcodes +++ b/regen/opcodes @@ -379,8 +379,8 @@ getpeername getpeername ck_fun is% Fs # Stat calls. OP_IS_FILETEST wants them consecutive. -lstat lstat ck_ftst u- F -stat stat ck_ftst u- F +lstat lstat ck_ftst u- F? +stat stat ck_ftst u- F? ftrread -R ck_ftst isu- F-+ ftrwrite -W ck_ftst isu- F-+ ftrexec -X ck_ftst isu- F-+ diff --git a/t/op/cproto.t b/t/op/cproto.t index 7d63c68..9711f82 100644 --- a/t/op/cproto.t +++ b/t/op/cproto.t @@ -140,7 +140,7 @@ local undef localtime (;$) lock (\[$@%*]) log (_) -lstat (*) +lstat (;*) lt undef m undef map undef @@ -227,7 +227,7 @@ split undef sprintf ($@) sqrt (_) srand (;$) -stat (*) +stat (;*) state undef study undef sub undef