The T_PTROBJ INPUT in stock typemap only uses 'sv_derived_from' for
input validation, that cause a segfault when the argument passed match
the class name.
${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
\"$var\", \"$ntype\")
T_PTROBJ
- if (sv_derived_from($arg, \"${ntype}\")) {
+ if (SvROK($arg) && sv_derived_from($arg, \"${ntype}\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type,tmp);
}