Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid a NULL escaping.
  • Loading branch information
jnthn committed Apr 10, 2013
1 parent 18f5d04 commit ebd44e7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ops/nqp.ops
Expand Up @@ -1728,11 +1728,15 @@ into $1.

*/
inline op get_sub_code_object(out PMC, invar PMC) :base_core {
if ($2->vtable->base_type == enum_class_Sub)
GETATTR_Sub_multi_signature(interp, $2, $1);
else
if ($2->vtable->base_type == enum_class_Sub) {
PMC *obj;
GETATTR_Sub_multi_signature(interp, $2, obj);
$1 = obj ? obj : PMCNULL;
}
else {
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
"Can only use get_sub_code_object if second operand is a Sub.");
}
}


Expand Down

0 comments on commit ebd44e7

Please sign in to comment.