summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authordearblue <[email protected]>2019-08-18 14:45:35 +0900
committerdearblue <[email protected]>2019-08-18 15:00:32 +0900
commit279c21b816777b8b25457b27fd1994a9fe359a98 (patch)
treeb34cd6e85842f4fb96b4b596bf5a7c1e554bc0ca /include
parent83dab1ee0d0d3aa76e44f7fbf14360ee501be151 (diff)
downloadmruby-279c21b816777b8b25457b27fd1994a9fe359a98.tar.gz
mruby-279c21b816777b8b25457b27fd1994a9fe359a98.zip
Prohibit changes to iseq in principle
Diffstat (limited to 'include')
-rw-r--r--include/mruby.h10
-rw-r--r--include/mruby/irep.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/include/mruby.h b/include/mruby.h
index 55505a213..b1b983f52 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -127,8 +127,8 @@ typedef struct {
uint16_t ridx;
uint16_t epos;
struct REnv *env;
- mrb_code *pc; /* return address */
- mrb_code *err; /* error position */
+ const mrb_code *pc; /* return address */
+ const mrb_code *err; /* error position */
int argc;
int acc;
struct RClass *target_class;
@@ -243,8 +243,8 @@ typedef struct mrb_state {
#endif
#ifdef MRB_ENABLE_DEBUG_HOOK
- void (*code_fetch_hook)(struct mrb_state* mrb, struct mrb_irep *irep, mrb_code *pc, mrb_value *regs);
- void (*debug_op_hook)(struct mrb_state* mrb, struct mrb_irep *irep, mrb_code *pc, mrb_value *regs);
+ void (*code_fetch_hook)(struct mrb_state* mrb, struct mrb_irep *irep, const mrb_code *pc, mrb_value *regs);
+ void (*debug_op_hook)(struct mrb_state* mrb, struct mrb_irep *irep, const mrb_code *pc, mrb_value *regs);
#endif
#ifdef MRB_BYTECODE_DECODE_OPTION
@@ -1057,7 +1057,7 @@ MRB_API mrb_value mrb_top_self(mrb_state *);
MRB_API mrb_value mrb_run(mrb_state*, struct RProc*, mrb_value);
MRB_API mrb_value mrb_top_run(mrb_state*, struct RProc*, mrb_value, unsigned int);
MRB_API mrb_value mrb_vm_run(mrb_state*, struct RProc*, mrb_value, unsigned int);
-MRB_API mrb_value mrb_vm_exec(mrb_state*, struct RProc*, mrb_code*);
+MRB_API mrb_value mrb_vm_exec(mrb_state*, struct RProc*, const mrb_code*);
/* compatibility macros */
#define mrb_toplevel_run_keep(m,p,k) mrb_top_run((m),(p),mrb_top_self(m),(k))
#define mrb_toplevel_run(m,p) mrb_toplevel_run_keep((m),(p),0)
diff --git a/include/mruby/irep.h b/include/mruby/irep.h
index d42fd0fb8..2989e0647 100644
--- a/include/mruby/irep.h
+++ b/include/mruby/irep.h
@@ -32,7 +32,7 @@ typedef struct mrb_irep {
uint16_t nregs; /* Number of register variables */
uint8_t flags;
- mrb_code *iseq;
+ const mrb_code *iseq;
mrb_value *pool;
mrb_sym *syms;
struct mrb_irep **reps;
@@ -80,7 +80,7 @@ struct mrb_insn_data {
uint8_t c;
};
-struct mrb_insn_data mrb_decode_insn(mrb_code *pc);
+struct mrb_insn_data mrb_decode_insn(const mrb_code *pc);
MRB_END_DECL