[svn:parrot] r45685 - branches/immutable_strings_part1/src/string
bacek at svn.parrot.org
bacek at svn.parrot.org
Thu Apr 15 12:20:31 UTC 2010
Author: bacek
Date: Thu Apr 15 12:20:31 2010
New Revision: 45685
URL: https://trac.parrot.org/parrot/changeset/45685
Log:
Throw exception on attempt to replace in NULL strings.
Modified:
branches/immutable_strings_part1/src/string/api.c
Modified: branches/immutable_strings_part1/src/string/api.c
==============================================================================
--- branches/immutable_strings_part1/src/string/api.c Thu Apr 15 12:20:19 2010 (r45684)
+++ branches/immutable_strings_part1/src/string/api.c Thu Apr 15 12:20:31 2010 (r45685)
@@ -1157,6 +1157,11 @@
UINTVAL start_byte, end_byte;
INTVAL diff, buf_size;
+ if (STRING_IS_NULL(src)) {
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
+ "Can't replace in NULL string");
+ }
+
/* abs(-offset) may not be > strlen-1 */
if (offset < 0)
true_offset = (UINTVAL)(src->strlen + offset);
More information about the parrot-commits
mailing list