From b023f5a2aaa2ffe5ce02f2e87bc462982c28ba7e Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 31 Jul 2012 20:02:03 +0000 Subject: [PATCH] fix allocate/free size mismatch in interpret.cpp This was causing a crash every time the VM was run when build using mode=debug and process=interpret. --- src/interpret.cpp | 2 +- src/posix.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/interpret.cpp b/src/interpret.cpp index 9f28a2f769..c3617122a5 100644 --- a/src/interpret.cpp +++ b/src/interpret.cpp @@ -3166,7 +3166,7 @@ class MyProcessor: public Processor { } virtual void dispose(vm::Thread* t) { - t->m->heap->free(t, sizeof(Thread)); + t->m->heap->free(t, sizeof(Thread) + t->m->stackSizeInBytes); } virtual void dispose() { diff --git a/src/posix.cpp b/src/posix.cpp index 6b2184011b..6ea15ab118 100644 --- a/src/posix.cpp +++ b/src/posix.cpp @@ -904,6 +904,7 @@ class MySystem: public System { } virtual void abort() { + *static_cast(0) = 0; ::abort(); }