diff options
author | Tony Cook <tony@develop-help.com> | 2022-09-20 10:53:50 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2022-09-21 11:49:12 +1000 |
commit | 818308540a041c9db1e5925678cf5da96ff16475 (patch) | |
tree | 5811d29d80e3d2494afb822cae9ce61958691e84 /embed.fnc | |
parent | 95f41c51341174e5fa41cc0551253e30ee27170e (diff) | |
download | perl-818308540a041c9db1e5925678cf5da96ff16475.tar.gz |
make expr parameter to newLOOPOP() NN, it was required anyway
Coverity picked up that while we checked that expr was non-NULL
in newLOOPOP(), the call to new_logop() dereferenced it anyway,
the address of expr is passed to new_logop(), which sees it as firstp
(so firstp == &expr), that is then derefed to first (first == expr)
and then switches on first->op_type, hence dereferencing expr.
Since both callers always pass in an expr value, and the code
would have crashed anyway with a NULL expr, make it required.
Diffstat (limited to 'embed.fnc')
-rw-r--r-- | embed.fnc | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1472,7 +1472,7 @@ ApdR |OP* |newGIVENOP |NN OP* cond|NN OP* block|PADOFFSET defsv_off ApdR |OP* |newLOGOP |I32 optype|I32 flags|NN OP *first|NN OP *other px |LOGOP* |alloc_LOGOP |I32 type|NULLOK OP *first|NULLOK OP *other ApdR |OP* |newLOOPEX |I32 type|NN OP* label -ApdR |OP* |newLOOPOP |I32 flags|I32 debuggable|NULLOK OP* expr|NULLOK OP* block +ApdR |OP* |newLOOPOP |I32 flags|I32 debuggable|NN OP* expr|NULLOK OP* block ApdR |OP* |newNULLLIST ApdR |OP* |newOP |I32 optype|I32 flags Cp |void |newPROG |NN OP* o |