summaryrefslogtreecommitdiffhomepage
path: root/src/class.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-06-05 07:43:40 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 16:21:03 +0900
commit5a3e014e4914dbd6421dbbd81e889cd6952e924b (patch)
tree0975df1e1554c177d1b7adb1081d70d74c5bf505 /src/class.c
parent744ba809198d79198246dbd6936a53fa98269ccb (diff)
downloadmruby-5a3e014e4914dbd6421dbbd81e889cd6952e924b.tar.gz
mruby-5a3e014e4914dbd6421dbbd81e889cd6952e924b.zip
Constify `irep` members.
- `pool` - `syms` - `reps`
Diffstat (limited to 'src/class.c')
-rw-r--r--src/class.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/class.c b/src/class.c
index 2864fdda9..daba6f649 100644
--- a/src/class.c
+++ b/src/class.c
@@ -2315,12 +2315,14 @@ init_class_new(mrb_state *mrb, struct RClass *cls)
struct RProc *p;
mrb_method_t m;
mrb_irep *new_irep = (mrb_irep*)mrb_malloc(mrb, sizeof(mrb_irep));
+ mrb_sym *syms;
static const mrb_irep mrb_irep_zero = { 0 };
*new_irep = mrb_irep_zero;
- new_irep->syms = (mrb_sym*)mrb_malloc(mrb, sizeof(mrb_sym)*2);
- new_irep->syms[0] = MRB_SYM(allocate);
- new_irep->syms[1] = MRB_SYM(initialize);
+ syms = (mrb_sym*)mrb_malloc(mrb, sizeof(mrb_sym)*2);
+ syms[0] = MRB_SYM(allocate);
+ syms[1] = MRB_SYM(initialize);
+ new_irep->syms = syms;
new_irep->slen = 2;
new_irep->flags = MRB_ISEQ_NO_FREE;
new_irep->iseq = new_iseq;