mjit_worker.c: do no access pointer after free

When we return there, `unit` is already freed.
This is detected by coverity scan.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-11-02 11:40:43 +00:00
Родитель 5de7b3b4f2
Коммит 6e9703b011
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -1045,12 +1045,13 @@ convert_unit_to_func(struct rb_mjit_unit *unit, struct rb_call_cache *cc_entries
if (!mjit_opts.save_temps)
remove_file(c_file);
free_unit(unit);
in_jit = FALSE; /* just being explicit for return */
}
else {
in_jit = TRUE;
}
CRITICAL_SECTION_FINISH(3, "before mjit_compile to wait GC finish");
if (unit->iseq == NULL) {
if (!in_jit) {
return (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC;
}