mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
7b7bffd5a8
Issue #1137. In the present implementation, when calling mrb_load_string continuously, irep is not released. Therefore, a 16-bit index was overflowing.
41 lines
631 B
C
41 lines
631 B
C
/*
|
|
** mruby/irep.h - mrb_irep structure
|
|
**
|
|
** See Copyright Notice in mruby.h
|
|
*/
|
|
|
|
#ifndef MRUBY_IREP_H
|
|
#define MRUBY_IREP_H
|
|
|
|
#if defined(__cplusplus)
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct mrb_irep {
|
|
uint32_t idx;
|
|
uint16_t nlocals;
|
|
uint16_t nregs;
|
|
uint8_t flags;
|
|
|
|
mrb_code *iseq;
|
|
mrb_value *pool;
|
|
mrb_sym *syms;
|
|
|
|
/* debug info */
|
|
const char *filename;
|
|
uint16_t *lines;
|
|
|
|
size_t ilen, plen, slen;
|
|
} mrb_irep;
|
|
|
|
#define MRB_ISEQ_NO_FREE 1
|
|
|
|
mrb_irep *mrb_add_irep(mrb_state *mrb);
|
|
mrb_value mrb_load_irep(mrb_state*, const uint8_t*);
|
|
|
|
#if defined(__cplusplus)
|
|
} /* extern "C" { */
|
|
#endif
|
|
|
|
#endif /* MRUBY_IREP_H */
|