Created
July 5, 2010 15:57
-
-
Save anonymous/464491 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
=item deref_unless_object(out PMC, in PMC) | |
If the value underlying $2 is anything but an Object or P6opaque, | |
return that value; otherwise return $2. | |
=cut | |
*/ | |
inline op deref_unless_object(out PMC, in PMC) :base_core { | |
PMC * val; | |
val = $2; | |
while (val->vtable->base_type == or_id || val->vtable->base_type == p6s_id) | |
val = VTABLE_get_pmc(interp, val); | |
$1 = (val->vtable->basetype == obj_id || val->vtable->basetype == p6o_id) | |
? $2 : val; | |
goto NEXT(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment