diff --git a/src/compile.cpp b/src/compile.cpp index 48ab0aebeb..b1f5e0111a 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -6254,7 +6254,7 @@ class MyProcessor: public Processor { collect(t, Heap::MinorCollection); } - return visitor.trace; + return visitor.trace ? visitor.trace : makeArray(t, 0); } virtual void initialize(BootImage* image, uint8_t* code, unsigned capacity) { diff --git a/src/posix.cpp b/src/posix.cpp index b2b3800eee..fd45942ec5 100644 --- a/src/posix.cpp +++ b/src/posix.cpp @@ -628,13 +628,16 @@ class MySystem: public System { visitTarget = target; int rv = pthread_kill(target->thread, VisitSignal); - expect(this, rv == 0); - while (visitTarget) visitLock->wait(t, 0); + if (rv == 0) { + while (visitTarget) visitLock->wait(t, 0); - threadVisitor = 0; + threadVisitor = 0; - return 0; + return 0; + } else { + return -1; + } } virtual uint64_t call(void* function, uintptr_t* arguments, uint8_t* types,