summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-31 06:23:12 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-31 06:23:12 +0000
commit59e7186f90f13f9b1945035df4ce5a5117d604dc (patch)
tree0d97cb2b5b87e023f44c46034b8bd3b6bf09fddd /universal.c
parent40986f42b4dca4ed841e1a7f7d848e9b5f199680 (diff)
downloadperl-59e7186f90f13f9b1945035df4ce5a5117d604dc.tar.gz
Fix the error message "Can't call method "DOES" on unblessed
reference". p4raw-id: //depot/perl@30806
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/universal.c b/universal.c
index adfddb5ae0..182b5c9638 100644
--- a/universal.c
+++ b/universal.c
@@ -185,6 +185,7 @@ Perl_sv_does(pTHX_ SV *sv, const char *name)
{
const char *classname;
bool does_it;
+ SV *methodname;
dSP;
ENTER;
@@ -210,7 +211,12 @@ Perl_sv_does(pTHX_ SV *sv, const char *name)
XPUSHs(sv_2mortal(newSVpv(name, 0)));
PUTBACK;
- call_method("isa", G_SCALAR);
+ methodname = sv_2mortal(newSVpv("isa", 0));
+ /* ugly hack: use the SvSCREAM flag so S_method_common
+ * can figure out we're calling DOES() and not isa(),
+ * and report eventual errors correctly. --rgs */
+ SvSCREAM_on(methodname);
+ call_sv(methodname, G_SCALAR | G_METHOD);
SPAGAIN;
does_it = SvTRUE( TOPs );