diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-06-23 09:49:14 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-06-23 09:49:14 +0900 |
| commit | 2d781f5c1da6f627d9b4d3c2c7e9444108e09221 (patch) | |
| tree | 57df9993b71c0dcb67c80ea9ecdbc82624796035 /src | |
| parent | 771ab3bc4e8f9818f934b4203d6adf24ec1df501 (diff) | |
| download | mruby-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.c | 3 | ||||
| -rw-r--r-- | src/vm.c | 2 |
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); } @@ -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[] = { |
