summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorJohn Peacock <jpeacock@cpan.org>2011-12-06 20:55:09 -0500
committerDavid Golden <dagolden@cpan.org>2011-12-09 14:59:04 -0500
commit573a19fb2c79f41cfc7f3db5a8ad14e14a4dccf9 (patch)
treee7c0c975264052c4d7fb48acafc9a91c8566ebc2 /sv.c
parenta97f6d148c766c74f3c3200d95d9fbf569067b45 (diff)
downloadperl-573a19fb2c79f41cfc7f3db5a8ad14e14a4dccf9.tar.gz
Use syntax from perlguts for testing objects
The following paragraph is in perlguts.pod: To check if you've got an object derived from a specific class you have to write: if (sv_isobject(sv) && sv_derived_from(sv, class)) { ... } which does the right thing with magical things like tied scalars. Signed-off-by: David Golden <dagolden@cpan.org>
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index ae97f1d6a2..cf29ffad54 100644
--- a/sv.c
+++ b/sv.c
@@ -10354,7 +10354,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *const sv, const char *const pat, const STRLEN patlen,
* back into v-string notation and then let the
* vectorize happen normally
*/
- if (sv_derived_from(vecsv, "version") && SvROK(vecsv)) {
+ if (sv_isobject(vecsv) && sv_derived_from(vecsv, "version")) {
char *version = savesvpv(vecsv);
if ( hv_exists(MUTABLE_HV(SvRV(vecsv)), "alpha", 5 ) ) {
Perl_warner(aTHX_ packWARN(WARN_INTERNAL),