summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mjit.c b/mjit.c
index 215057ae30..888f0461aa 100644
--- a/mjit.c
+++ b/mjit.c
@@ -24,7 +24,15 @@
static void
mjit_copy_job_handler(void *data)
{
- struct mjit_copy_job *job = (struct mjit_copy_job *)data;
+ struct mjit_copy_job *job;
+ if (stop_worker_p) {
+ /* `copy_cache_from_main_thread()` stops to wait for this job. Then job
+ data which is allocated by `alloca()` could be expired and we might
+ not be able to access that. */
+ return;
+ }
+
+ job = (struct mjit_copy_job *)data;
if (job->cc_entries) {
memcpy(job->cc_entries, job->body->cc_entries, sizeof(struct rb_call_cache) * (job->body->ci_size + job->body->ci_kw_size));
}