Improves out of memory messages for eval

The comment says that if `mrb_parse_nstring()` returns `NULL`, it is only out of memory.
I'm worried about compatibility if I set the exception class to `NoMemoryError`, so it's still `RuntimeError`.
This commit is contained in:
dearblue
2020-12-25 23:23:14 +09:00
parent 825c14a0c5
commit 88a11d81b0
+1 -1
View File
@@ -39,7 +39,7 @@ create_proc_from_string(mrb_state *mrb, const char *s, mrb_int len, mrb_value bi
/* only occur when memory ran out */
if (!p) {
mrb_raise(mrb, E_RUNTIME_ERROR, "Failed to create parser state.");
mrb_raise(mrb, E_RUNTIME_ERROR, "Failed to create parser state (out of memory)");
}
if (0 < p->nerr) {