Skip to content

Commit 09d9a88

Browse files
committed
amagic_call: quieten Coverity complaint about PL_op
Coverity complained here since if force_scalar were false while PL_op was NULL, with the previous code this would call GIMME_V which immediately dereferences PL_op, which would be UB.
1 parent 6fb219f commit 09d9a88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4170,7 +4170,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
41704170
* with the context of individual concats being scalar,
41714171
* regardless of the overall context of the multiconcat op
41724172
*/
4173-
U8 gimme = (force_scalar || (PL_op && PL_op->op_type == OP_MULTICONCAT))
4173+
U8 gimme = (force_scalar || !PL_op || PL_op->op_type == OP_MULTICONCAT)
41744174
? G_SCALAR : GIMME_V;
41754175

41764176
CATCH_SET(TRUE);

0 commit comments

Comments
 (0)