Skip to content

Commit aeaf125

Browse files
committed
Remove redundant special handling of OP_ARGELEM from tokenizer
Previously, the op fragments created here were woven into the signature handling part of the final optree and had to contain a few extra fields related to signature argument handling. Since `subsignature_finish()` now creates the entire optree itself, the ops created by the tokenizer are only used for their side-effect of containing the pad offset in `op_targ`. As such, they no longer need to be specially sized OP_ARGELEM and can be regular OP_PADANYs.
1 parent 0aba7db commit aeaf125

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

toke.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9997,25 +9997,7 @@ S_pending_ident(pTHX)
99979997
GCC_DIAG_RESTORE_STMT;
99989998
}
99999999

10000-
if (PL_in_my == KEY_sigvar) {
10001-
/* A signature 'padop' needs in addition, an op_first to
10002-
* point to a child sigdefelem, and an extra field to hold
10003-
* the signature index. We can achieve both by using an
10004-
* UNOP_AUX and (ab)using the op_aux field to hold the
10005-
* index. If we ever need more fields, use a real malloced
10006-
* aux strut instead.
10007-
*/
10008-
assert(PL_parser->signature);
10009-
/* We don't yet know the argindex but subsignature_append_*()
10010-
* will fill it in
10011-
*/
10012-
o = newUNOP_AUX(OP_ARGELEM, 0, NULL, NULL);
10013-
o->op_private |= ( PL_tokenbuf[0] == '$' ? OPpARGELEM_SV
10014-
: PL_tokenbuf[0] == '@' ? OPpARGELEM_AV
10015-
: OPpARGELEM_HV);
10016-
}
10017-
else
10018-
o = newOP(OP_PADANY, 0);
10000+
o = newOP(OP_PADANY, 0);
1001910001
o->op_targ = allocmy(PL_tokenbuf, tokenbuf_len,
1002010002
UTF ? SVf_UTF8 : 0);
1002110003
if (PL_in_my == KEY_sigvar)

0 commit comments

Comments
 (0)