diff options
| author | cubicdaiya <[email protected]> | 2014-03-04 01:03:23 +0900 |
|---|---|---|
| committer | cubicdaiya <[email protected]> | 2014-03-04 02:45:53 +0900 |
| commit | 019d15c3eedb0fdb9412a3b67180da368c74bdd1 (patch) | |
| tree | 5b70358a37a209a21eb716ec60233e330a8a20bc /src/vm.c | |
| parent | a514e31f6b9703bf74293714b12714ee6745f872 (diff) | |
| download | mruby-019d15c3eedb0fdb9412a3b67180da368c74bdd1.tar.gz mruby-019d15c3eedb0fdb9412a3b67180da368c74bdd1.zip | |
Use mrb_exc_new_str_lit widely
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1209,8 +1209,7 @@ RETRY_TRY_BLOCK: struct REnv *e = uvenv(mrb, lv-1); if (!e) { mrb_value exc; - static const char m[] = "super called outside of method"; - exc = mrb_exc_new(mrb, E_NOMETHOD_ERROR, m, sizeof(m) - 1); + exc = mrb_exc_new_str_lit(mrb, E_NOMETHOD_ERROR, "super called outside of method"); mrb->exc = mrb_obj_ptr(exc); goto L_RAISE; } @@ -1424,7 +1423,7 @@ RETRY_TRY_BLOCK: goto L_RAISE; } if (mrb->c->prev->ci == mrb->c->prev->cibase) { - mrb_value exc = mrb_exc_new_str(mrb, E_RUNTIME_ERROR, mrb_str_new_lit(mrb, "double resume")); + mrb_value exc = mrb_exc_new_str_lit(mrb, E_RUNTIME_ERROR, "double resume"); mrb->exc = mrb_obj_ptr(exc); goto L_RAISE; } @@ -2192,8 +2191,7 @@ RETRY_TRY_BLOCK: CASE(OP_TCLASS) { /* A B R(A) := target_class */ if (!mrb->c->ci->target_class) { - static const char msg[] = "no target class or module"; - mrb_value exc = mrb_exc_new(mrb, E_TYPE_ERROR, msg, sizeof(msg) - 1); + mrb_value exc = mrb_exc_new_str_lit(mrb, E_TYPE_ERROR, "no target class or module"); mrb->exc = mrb_obj_ptr(exc); goto L_RAISE; } |
