]> granicus.if.org Git - postgresql/commitdiff
Instruct Coverity using an assertion.
authorNoah Misch <noah@leadboat.com>
Sat, 5 Dec 2015 08:04:17 +0000 (03:04 -0500)
committerNoah Misch <noah@leadboat.com>
Sat, 5 Dec 2015 08:04:17 +0000 (03:04 -0500)
This should make Coverity deduce that plperl_call_perl_func() does not
dereference NULL argtypes.  Back-patch to 9.5, where the affected code
was introduced.

Michael Paquier

src/pl/plperl/plperl.c

index 87dc6f0c3ba300772f2f5721954cd02448b17596..b35ef3f64bcd504404800df84ad427a3a849dc67 100644 (file)
@@ -2111,8 +2111,10 @@ plperl_call_perl_func(plperl_proc_desc *desc, FunctionCallInfo fcinfo)
        PUSHMARK(SP);
        EXTEND(sp, desc->nargs);
 
+       /* Get signature for true functions; inline blocks have no args. */
        if (fcinfo->flinfo->fn_oid)
                get_func_signature(fcinfo->flinfo->fn_oid, &argtypes, &nargs);
+       Assert(nargs == desc->nargs);
 
        for (i = 0; i < desc->nargs; i++)
        {