diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2022-10-08 00:33:40 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-08 00:33:40 +1300 |
commit | 24f3e397e957a6747a2067edd831bc7920e204ec (patch) | |
tree | c8e88edd04574492619296e934465b7866ee0121 /vm_eval.c | |
parent | 1e6cdc76e4b11084f85b2b4718090787a500fd69 (diff) |
Add spec for `Coverage.supported?` and `start(eval: true)`. (#6499)
* Don't emit coverage for eval when eval coverage is disabled.
Notes
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
Diffstat (limited to 'vm_eval.c')
-rw-r--r-- | vm_eval.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -11,6 +11,7 @@ **********************************************************************/ +#include "internal/thread.h" struct local_var_list { VALUE tbl; }; @@ -1672,7 +1673,9 @@ eval_make_iseq(VALUE src, VALUE fname, int line, const rb_binding_t *bind, rb_iseq_t *iseq = NULL; rb_ast_t *ast; int isolated_depth = 0; - int coverage_enabled = Qtrue; + + // Conditionally enable coverage depending on the current mode: + VALUE coverage_enabled = RBOOL(rb_get_coverage_mode() & COVERAGE_TARGET_EVAL); { int depth = 1; |