aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-24 21:01:09 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-24 21:01:09 +0000
commit14428f09b1c75071b7bcd86fb6c7a92790301d17 (patch)
treeccc166e8e895acaeedf0abff78e0ebe7c8dcbdf0 /iseq.c
parentefa31acaad8663602357fb193db8dd4320fa66d5 (diff)
downloadruby-14428f09b1c75071b7bcd86fb6c7a92790301d17.tar.gz
* 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
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/iseq.c b/iseq.c
index 2be4f89e66..20b7dc77a2 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1060,11 +1060,11 @@ iseqw_to_a(VALUE self)
/* TODO: search algorithm is brute force.
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)
{
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;
if (debug) {
@@ -1098,7 +1098,8 @@ get_line_info(const rb_iseq_t *iseq, size_t pos)
static unsigned int
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) {
return entry->line_no;
}