From eea8aa555f67b8a95d87a56b4517c7d8d8075b18 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Tue, 3 Oct 2023 00:14:25 -0500 Subject: [PATCH] Revert dccb60b to address #1299 This commit was to address issues with a use after free error in the windows event loop, but the erroneous code was later reworked. --- README.md | 2 +- src/core/ev.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index df3d3240..8385aa62 100644 --- a/README.md +++ b/README.md @@ -383,7 +383,7 @@ Usually, one of a few reasons: ### Can I bind to Rust/Zig/Go/Java/Nim/C++/D/Pascal/Fortran/Odin/Jai/(Some new "Systems" Programming Language)? Probably, if that language has a good interface with C. But the programmer may need to do -some extra work to map Janet's internal memory model may need some to that of the bound language. Janet +some extra work to map Janet's internal memory model to that of the bound language. Janet also uses `setjmp`/`longjmp` for non-local returns internally. This approach is out of favor with many programmers now and doesn't always play well with other languages that have exceptions or stack-unwinding. diff --git a/src/core/ev.c b/src/core/ev.c index 1bb83270..5b0914f5 100644 --- a/src/core/ev.c +++ b/src/core/ev.c @@ -1514,11 +1514,7 @@ void janet_loop1_impl(int has_timeout, JanetTimestamp to) { } BOOL result = GetQueuedCompletionStatus(janet_vm.iocp, &num_bytes_transfered, &completionKey, &overlapped, (DWORD) waittime); - if (!result) { - return; - } - - if (overlapped) { + if (result || overlapped) { if (0 == completionKey) { /* Custom event */ JanetSelfPipeEvent *response = (JanetSelfPipeEvent *)(overlapped);