From d65f7458bc8b4fa4404c41713cfa1ece5260fc8a Mon Sep 17 00:00:00 2001 From: mame Date: Wed, 22 Aug 2018 10:38:56 +0000 Subject: parse.y: remove coverage-related code fragments The code fragments that initializes coverage data were scattered into both parse.y and compile.c. parse.y allocated a coverage data, and compile.c initialize the data. To remove this cross-cutting concern, this change moves the allocation from "coverage" function of parse.y to "rb_iseq_new_top" of iseq.c. For the sake, parse.y just counts the line number of the original source code, and the number is passed via rb_ast_body_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'vm.c') diff --git a/vm.c b/vm.c index b43a30e808..5c33cfb300 100644 --- a/vm.c +++ b/vm.c @@ -970,6 +970,7 @@ rb_binding_add_dynavars(VALUE bindval, rb_binding_t *bind, int dyncount, const I rb_node_init(&tmp_node, NODE_SCOPE, (VALUE)dyns, 0, 0); ast.root = &tmp_node; ast.compile_option = 0; + ast.line_count = -1; if (base_iseq) { iseq = rb_iseq_new(&ast, base_iseq->body->location.label, path, realpath, base_iseq, ISEQ_TYPE_EVAL); -- cgit v1.2.3