Commit 07075d3528 for perl
commit 07075d3528582c24b2f5163b0bfd9acb368ca202
Author: Yves Orton <demerphq@gmail.com>
Date: Mon Nov 16 16:29:55 2026 +0100
op: avoid checking a nonnull slice target for null
Remove the redundant target check in build_list_slice(). Its target
argument is declared nonnull and checked by
PERL_ARGS_ASSERT_BUILD_LIST_SLICE. The hash and key/value array paths
already dereference it through oopsHV() or oopsAV().
Clang diagnoses the check with -Wpointer-bool-conversion, which stops a
-Werror build. Keep the check for a null result op and preserve
slice-warning propagation.
diff --git a/op.c b/op.c
index c3ea6f6bd5..99a815f6aa 100644
--- a/op.c
+++ b/op.c
@@ -5032,7 +5032,7 @@ Perl_build_list_slice(pTHX_ I32 operation, OP *target, OP *selector)
newLISTOP(operation, 0, selector, container)
);
- if (op && target)
+ if (op)
op->op_private |= target->op_private & OPpSLICEWARNING;
return op;