summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-04-15 20:54:44 +0000
committerNicholas Clark <nick@ccl4.org>2006-04-15 20:54:44 +0000
commit578e3dbccd1bcbfde2fd9bf4c78cf0432beb8492 (patch)
tree5662b7fa9e811d267d10f2034e5608444ab29c4d
parent67e70b337a8efad4c893a32652ba61fe203f5803 (diff)
downloadperl-578e3dbccd1bcbfde2fd9bf4c78cf0432beb8492.tar.gz
Update the assertion to a croak "Out of range special SV number"
to give ByteLoader more meaningful failure diagnostics. p4raw-id: //depot/perl@27822
-rw-r--r--ext/ByteLoader/bytecode.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/ByteLoader/bytecode.h b/ext/ByteLoader/bytecode.h
index 1d06b08877..3e6f9d9e33 100644
--- a/ext/ByteLoader/bytecode.h
+++ b/ext/ByteLoader/bytecode.h
@@ -91,9 +91,11 @@ typedef char *pvindex;
arg = arg ? savepv(arg) : arg; \
} STMT_END
-#define BSET_ldspecsv(sv, arg) STMT_START { \
- assert(arg < sizeof(specialsv_list) / sizeof(specialsv_list[0])); \
- sv = specialsv_list[arg]; \
+#define BSET_ldspecsv(sv, arg) STMT_START { \
+ if(arg >= sizeof(specialsv_list) / sizeof(specialsv_list[0])) { \
+ Perl_croak(aTHX_ "Out of range special SV number %d", arg); \
+ } \
+ sv = specialsv_list[arg]; \
} STMT_END
#define BSET_ldspecsvx(sv, arg) STMT_START { \