Bug #1903: incorrect line returned (0) in rb_vm_get_sourceline()
http://redmine.ruby-lang.org/issues/show/1903

Author: Mark Moseley
Status: Open, Priority: Normal
Target version: 1.9.x
ruby -v: 1.9.2

If rb_vm_get_sourceline() is called when cfp->pc is equal to cfp->iseq->iseq_encoded (IOW, on the first instruction), then zero will be returned as the line number.

I think that if:
  iseq->insn_info_size > 0, and, 
  iseq->insn_info_table[0].position == 0, 
then:
  iseq->insn_info_table[0].line_no 

should be returned.


----------------------------------------
http://redmine.ruby-lang.org