summaryrefslogtreecommitdiff
path: root/ext/coverage
diff options
context:
space:
mode:
Diffstat (limited to 'ext/coverage')
-rw-r--r--ext/coverage/coverage.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/coverage/coverage.c b/ext/coverage/coverage.c
index c2ccd343d0..c4070faf56 100644
--- a/ext/coverage/coverage.c
+++ b/ext/coverage/coverage.c
@@ -82,13 +82,15 @@ branch_coverage(VALUE branches)
VALUE branches = RARRAY_AREF(structure, i);
VALUE base_type = RARRAY_AREF(branches, 0);
VALUE base_lineno = RARRAY_AREF(branches, 1);
+ VALUE base_column = RARRAY_AREF(branches, 2);
VALUE children = rb_hash_new();
- rb_hash_aset(ret, rb_ary_new_from_args(3, base_type, LONG2FIX(id++), base_lineno), children);
- for (j = 2; j < RARRAY_LEN(branches); j += 3) {
+ rb_hash_aset(ret, rb_ary_new_from_args(4, base_type, LONG2FIX(id++), base_lineno, base_column), children);
+ for (j = 3; j < RARRAY_LEN(branches); j += 4) {
VALUE target_label = RARRAY_AREF(branches, j);
VALUE target_lineno = RARRAY_AREF(branches, j + 1);
- int idx = FIX2INT(RARRAY_AREF(branches, j + 2));
- rb_hash_aset(children, rb_ary_new_from_args(3, target_label, LONG2FIX(id++), target_lineno), RARRAY_AREF(counters, idx));
+ VALUE target_column = RARRAY_AREF(branches, j + 2);
+ int idx = FIX2INT(RARRAY_AREF(branches, j + 3));
+ rb_hash_aset(children, rb_ary_new_from_args(4, target_label, LONG2FIX(id++), target_lineno, target_column), RARRAY_AREF(counters, idx));
}
}