summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-06-23 09:49:14 +0900
committerYukihiro Matsumoto <[email protected]>2012-06-23 09:49:14 +0900
commit2d781f5c1da6f627d9b4d3c2c7e9444108e09221 (patch)
tree57df9993b71c0dcb67c80ea9ecdbc82624796035 /src
parent771ab3bc4e8f9818f934b4203d6adf24ec1df501 (diff)
downloadmruby-2d781f5c1da6f627d9b4d3c2c7e9444108e09221.tar.gz
mruby-2d781f5c1da6f627d9b4d3c2c7e9444108e09221.zip
remove assertion for false assumption; mrb_str_new(0, len) where len > 0 can be used to allocate an unintialized string
Diffstat (limited to 'src')
-rw-r--r--src/string.c3
-rw-r--r--src/vm.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/string.c b/src/string.c
index 6b2df1590..a943512c7 100644
--- a/src/string.c
+++ b/src/string.c
@@ -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);
}
diff --git a/src/vm.c b/src/vm.c
index f3e5a497a..04392891f 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -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[] = {