remove assertion for false assumption; mrb_str_new(0, len) where len > 0 can be used to allocate an unintialized string

This commit is contained in:
Yukihiro Matsumoto
2012-06-23 09:49:14 +09:00
parent 771ab3bc4e
commit 2d781f5c1d
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -21,7 +21,6 @@
#include "regex.h"
#include "st.h"
#endif //ENABLE_REGEXP
#include <assert.h>
const char mrb_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
@@ -222,7 +221,7 @@ mrb_value
mrb_str_new(mrb_state *mrb, const char *p, int len)
{
struct RString *s;
assert(!(!p && len));
s = str_new(mrb, p, len);
return mrb_obj_value(s);
}
+1 -1
View File
@@ -393,7 +393,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
mrb_code i;
int ai = mrb->arena_idx;
jmp_buf c_jmp;
jmp_buf *prev_jmp = NULL;
volatile jmp_buf *prev_jmp = NULL;
#ifdef DIRECT_THREADED
static void *optable[] = {