summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-03-22 22:33:09 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-03-22 22:33:09 +0900
commit539d9cb855e396047cccccc84ffc88825d77bdf7 (patch)
tree92c63628f87308edbc0fbef7ce5e4f900dee517b /src
parent7182ef6358f0bdebfd1f949f89b8840e2042a394 (diff)
downloadmruby-539d9cb855e396047cccccc84ffc88825d77bdf7.tar.gz
mruby-539d9cb855e396047cccccc84ffc88825d77bdf7.zip
need not to add assertion in STR_SET_LEN() where n is mrb_int
Diffstat (limited to 'src')
-rw-r--r--src/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index 1b82802f9..648363a45 100644
--- a/src/string.c
+++ b/src/string.c
@@ -28,7 +28,6 @@
if (STR_EMBED_P(s)) {\
STR_SET_EMBED_LEN((s),(n));\
} else {\
- mrb_assert((n) <= MRB_INT_MAX);\
s->as.heap.len = (mrb_int)(n);\
}\
} while (0)
@@ -273,6 +272,7 @@ str_buf_cat(mrb_state *mrb, struct RString *s, const char *ptr, size_t len)
ptr = STR_PTR(s) + off;
}
memcpy(STR_PTR(s) + STR_LEN(s), ptr, len);
+ mrb_assert(total <= MRB_INT_MAX);
STR_SET_LEN(s, total);
STR_PTR(s)[total] = '\0'; /* sentinel */
}