From 2d781f5c1da6f627d9b4d3c2c7e9444108e09221 Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Sat, 23 Jun 2012 09:49:14 +0900 Subject: remove assertion for false assumption; mrb_str_new(0, len) where len > 0 can be used to allocate an unintialized string --- src/string.c | 3 +-- src/vm.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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 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[] = { -- cgit v1.2.3