summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2019-02-04 13:48:13 +0000
committerDavid Mitchell <davem@iabyn.com>2019-02-05 14:03:05 +0000
commit72876cce4ecc7d8756e00d284e32df0b943d0da9 (patch)
treeeb2fbf4d5389c41ab464221a1089a9eb00429389 /op.h
parent35c1827fadfaf0a26b8d1373f06ee242ee79c111 (diff)
downloadperl-72876cce4ecc7d8756e00d284e32df0b943d0da9.tar.gz
Eliminate opASSIGN macro usage from core
This macro is defined as (PL_op->op_flags & OPf_STACKED) and indicates, for ops which support it, that the mutator-variant of the op is present (e.g. $x += 1). This macro was mainly used as an arg for the old-style overloading macros (tryAMAGICbin()) which were eliminated several years ago. This commit removes its vestigial usage, and instead tests OPf_STACKED directly at each location, along with adding a comment about the significance of the flag. This removes one item of obfuscation from the overloading code. There is one potentially functional change in this commit: Perl_try_amagic_bin() was sometimes testing for OPf_STACKED without first checking that it had been called with the AMGf_assign flag (which indicates that this op supports a mutator variant). With this commit, it now checks first, so this is theoretically a bug fix. In practice that section of code was never reached without AMGf_assign always being set anyway.
Diffstat (limited to 'op.h')
-rw-r--r--op.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/op.h b/op.h
index 6d9dae849e..c9f05b2271 100644
--- a/op.h
+++ b/op.h
@@ -99,7 +99,12 @@ Deprecated. Use C<GIMME_V> instead.
#define OPf_REF 16 /* Certified reference. */
/* (Return container, not containee). */
#define OPf_MOD 32 /* Will modify (lvalue). */
+
#define OPf_STACKED 64 /* Some arg is arriving on the stack. */
+ /* Indicates mutator-variant of op for those
+ * ops which support them, e.g. $x += 1
+ */
+
#define OPf_SPECIAL 128 /* Do something weird for this op: */
/* On local LVAL, don't init local value. */
/* On OP_SORT, subroutine is inlined. */