mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-23 15:23:44 +02:00
Remove unnecessary cleanup code from rb_ec_tag_jump()
This commit is contained in:
parent
244d88908c
commit
23affbe96f
1 changed files with 0 additions and 21 deletions
|
@ -1,26 +1,5 @@
|
||||||
# Fixes a memory leak in WASI builds of Ruby where VM jump buffers are sometimes not freed.
|
# Fixes a memory leak in WASI builds of Ruby where VM jump buffers are sometimes not freed.
|
||||||
|
|
||||||
--- a/eval_intern.h
|
|
||||||
+++ b/eval_intern.h
|
|
||||||
@@ -163,6 +163,18 @@ rb_ec_tag_jump(const rb_execution_context_t *ec, enum ruby_tag_type st)
|
|
||||||
{
|
|
||||||
RUBY_ASSERT(st != TAG_NONE);
|
|
||||||
ec->tag->state = st;
|
|
||||||
+
|
|
||||||
+#if defined(__wasm__) && !defined(__EMSCRIPTEN__)
|
|
||||||
+ /* Destroy all the jump buffers that belong to tags between the current tag
|
|
||||||
+ * and the tag we're jumping to, since jump buffers are allocated on the
|
|
||||||
+ * heap on this platform instead of on the stack like on most other
|
|
||||||
+ * platforms. */
|
|
||||||
+ for (struct rb_vm_tag *tag = GET_EC()->tag; tag != ec->tag; tag = tag->prev) {
|
|
||||||
+ RUBY_ASSERT(tag != NULL);
|
|
||||||
+ rb_vm_tag_jmpbuf_deinit(&tag->buf);
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
ruby_longjmp(RB_VM_TAG_JMPBUF_GET(ec->tag->buf), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
--- a/signal.c
|
--- a/signal.c
|
||||||
+++ b/signal.c
|
+++ b/signal.c
|
||||||
@@ -849,6 +849,7 @@ check_stack_overflow(int sig, const uintptr_t addr, const ucontext_t *ctx)
|
@@ -849,6 +849,7 @@ check_stack_overflow(int sig, const uintptr_t addr, const ucontext_t *ctx)
|
||||||
|
|
Loading…
Add table
Reference in a new issue