mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vm_core.h: constify rb_iseq_constant_body::line_info_table.
* iseq.c: catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
efa31acaad
commit
14428f09b1
3 changed files with 11 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Sat Jul 25 06:00:09 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* vm_core.h: constify rb_iseq_constant_body::line_info_table.
|
||||||
|
|
||||||
|
* iseq.c: catch up this fix.
|
||||||
|
|
||||||
Sat Jul 25 05:56:43 2015 Koichi Sasada <ko1@atdot.net>
|
Sat Jul 25 05:56:43 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* vm_core.h: constify rb_iseq_constant_body::param::opt_table and
|
* vm_core.h: constify rb_iseq_constant_body::param::opt_table and
|
||||||
|
|
7
iseq.c
7
iseq.c
|
@ -1060,11 +1060,11 @@ iseqw_to_a(VALUE self)
|
||||||
/* TODO: search algorithm is brute force.
|
/* TODO: search algorithm is brute force.
|
||||||
this should be binary search or so. */
|
this should be binary search or so. */
|
||||||
|
|
||||||
static struct iseq_line_info_entry *
|
static const struct iseq_line_info_entry *
|
||||||
get_line_info(const rb_iseq_t *iseq, size_t pos)
|
get_line_info(const rb_iseq_t *iseq, size_t pos)
|
||||||
{
|
{
|
||||||
size_t i = 0, size = iseq->body->line_info_size;
|
size_t i = 0, size = iseq->body->line_info_size;
|
||||||
struct iseq_line_info_entry *table = iseq->body->line_info_table;
|
const struct iseq_line_info_entry *table = iseq->body->line_info_table;
|
||||||
const int debug = 0;
|
const int debug = 0;
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
|
@ -1098,7 +1098,8 @@ get_line_info(const rb_iseq_t *iseq, size_t pos)
|
||||||
static unsigned int
|
static unsigned int
|
||||||
find_line_no(const rb_iseq_t *iseq, size_t pos)
|
find_line_no(const rb_iseq_t *iseq, size_t pos)
|
||||||
{
|
{
|
||||||
struct iseq_line_info_entry *entry = get_line_info(iseq, pos);
|
const struct iseq_line_info_entry *entry = get_line_info(iseq, pos);
|
||||||
|
|
||||||
if (entry) {
|
if (entry) {
|
||||||
return entry->line_no;
|
return entry->line_no;
|
||||||
}
|
}
|
||||||
|
|
|
@ -330,7 +330,7 @@ struct rb_iseq_constant_body {
|
||||||
rb_iseq_location_t location;
|
rb_iseq_location_t location;
|
||||||
|
|
||||||
/* insn info, must be freed */
|
/* insn info, must be freed */
|
||||||
struct iseq_line_info_entry *line_info_table;
|
const struct iseq_line_info_entry *line_info_table;
|
||||||
|
|
||||||
const ID *local_table; /* must free */
|
const ID *local_table; /* must free */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue