summaryrefslogtreecommitdiffhomepage
path: root/src/load.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-03-04 08:37:38 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-03-04 08:37:38 +0900
commita3411c4c96c5975680b7198364127b19472cb20a (patch)
tree5b70358a37a209a21eb716ec60233e330a8a20bc /src/load.c
parente1b3cfa88e6043c6b9c21a944e40cc888f02bb0f (diff)
parent019d15c3eedb0fdb9412a3b67180da368c74bdd1 (diff)
downloadmruby-a3411c4c96c5975680b7198364127b19472cb20a.tar.gz
mruby-a3411c4c96c5975680b7198364127b19472cb20a.zip
Merge pull request #1789 from cubicdaiya/feature/mrb_exc_new_str_lit
Introduce mrb_exc_new_str_lit for C string literals
Diffstat (limited to 'src/load.c')
-rw-r--r--src/load.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/load.c b/src/load.c
index 857dd7740..de517f89f 100644
--- a/src/load.c
+++ b/src/load.c
@@ -12,6 +12,7 @@
#include "mruby/proc.h"
#include "mruby/string.h"
#include "mruby/debug.h"
+#include "mruby/error.h"
#if !defined(_WIN32) && SIZE_MAX < UINT32_MAX
# define SIZE_ERROR_MUL(x, y) ((x) > SIZE_MAX / (y))
@@ -467,8 +468,7 @@ mrb_read_irep(mrb_state *mrb, const uint8_t *bin)
static void
irep_error(mrb_state *mrb)
{
- static const char msg[] = "irep load error";
- mrb->exc = mrb_obj_ptr(mrb_exc_new(mrb, E_SCRIPT_ERROR, msg, sizeof(msg) - 1));
+ mrb->exc = mrb_obj_ptr(mrb_exc_new_str_lit(mrb, E_SCRIPT_ERROR, "irep load error"));
}
mrb_value