зеркало из https://github.com/github/ruby.git
make ext/coverage ASAN friendly
This commit is contained in:
Родитель
18b3f0f54c
Коммит
b328b83026
|
@ -11,6 +11,7 @@
|
|||
#include "gc.h"
|
||||
#include "internal/hash.h"
|
||||
#include "internal/thread.h"
|
||||
#include "internal/sanitizers.h"
|
||||
#include "ruby.h"
|
||||
#include "vm_core.h"
|
||||
|
||||
|
@ -150,6 +151,9 @@ method_coverage_i(void *vstart, void *vend, size_t stride, void *data)
|
|||
VALUE ncoverages = *(VALUE*)data, v;
|
||||
|
||||
for (v = (VALUE)vstart; v != (VALUE)vend; v += stride) {
|
||||
void *poisoned = asan_poisoned_object_p(v);
|
||||
asan_unpoison_object(v, false);
|
||||
|
||||
if (RB_TYPE_P(v, T_IMEMO) && imemo_type(v) == imemo_ment) {
|
||||
const rb_method_entry_t *me = (rb_method_entry_t *) v;
|
||||
VALUE path, first_lineno, first_column, last_lineno, last_column;
|
||||
|
@ -189,6 +193,10 @@ method_coverage_i(void *vstart, void *vend, size_t stride, void *data)
|
|||
rb_hash_aset(methods, key, rcount);
|
||||
}
|
||||
}
|
||||
|
||||
if (poisoned) {
|
||||
asan_poison_object(v);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче