[profiler] Fix coverage profiler on macos (mono/mono#17396)
authorVlad Brezae <brezaevlad@gmail.com>
Fri, 18 Oct 2019 14:31:47 +0000 (17:31 +0300)
committerBernhard Urban-Forster <lewurm@gmail.com>
Fri, 18 Oct 2019 14:31:47 +0000 (16:31 +0200)
commitd130ebb4b9d3b66fd33c417ed341aedede76372d
tree0eed589b26e67b40451bb926715b5ca02d0f4cac
parent80087082c2ed651d931219dbf41a96c0867dfc5f
[profiler] Fix coverage profiler on macos (mono/mono#17396)

If we have coverage profiling enabled for a method (mono_profiler_coverage_instrumentation_enabled, with coverage_filter callback), then we should be able to allocate a coverage info structure (mono_profiler_coverage_alloc). After https://github.com/mono/mono/commit/mono/mono@52429673dc617fd437518757c04c7448211075e9, coverage_filter was reporting wrapper methods as ok to profile, while mono_profiler_coverage_alloc was refusing to allocate the necessary structure, leading to crashes.

Commit migrated from https://github.com/mono/mono/commit/37f628750af0f81e7550989e83bcfe3d134fb6be
src/mono/mono/metadata/profiler.c
src/mono/mono/profiler/coverage.c