summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-12-28 13:46:26 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-12-28 13:46:26 -0800
commit69f00f6753978805180a07b2b8436ebad5ebb6c8 (patch)
tree30d3568bff60d9814dd7ca598b0c44d8a3e69a9c /pp.c
parent7e9044f980cffa21f055543f2d0818c838d0f632 (diff)
downloadperl-69f00f6753978805180a07b2b8436ebad5ebb6c8.tar.gz
pp.c:pp_rv2sv: Use >= instead of switch
This results in smaller machine code. If a freed SV is exposed to perl space then ${\$freed} will now die, which is arguably more correct.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/pp.c b/pp.c
index ff23fce24f..3ab9bc3aad 100644
--- a/pp.c
+++ b/pp.c
@@ -372,15 +372,8 @@ PP(pp_rv2sv)
}
sv = SvRV(sv);
- switch (SvTYPE(sv)) {
- case SVt_PVAV:
- case SVt_PVHV:
- case SVt_PVCV:
- case SVt_PVFM:
- case SVt_PVIO:
+ if (SvTYPE(sv) >= SVt_PVAV)
DIE(aTHX_ "Not a SCALAR reference");
- default: NOOP;
- }
}
else {
gv = MUTABLE_GV(sv);