Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created November 29, 2015 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnthn/c42ed1caa3f7ff0ac073 to your computer and use it in GitHub Desktop.
Save jnthn/c42ed1caa3f7ff0ac073 to your computer and use it in GitHub Desktop.
diff --git a/src/gc/allocation.c b/src/gc/allocation.c
index 2d31dc6..ebb300e 100644
--- a/src/gc/allocation.c
+++ b/src/gc/allocation.c
@@ -104,5 +104,7 @@ void MVM_gc_allocate_gen2_default_set(MVMThreadContext *tc) {
/* Sets allocation for this thread to be from the nursery by default. */
void MVM_gc_allocate_gen2_default_clear(MVMThreadContext *tc) {
+ if (tc->allocate_in_gen2 <= 0)
+ MVM_oops(tc, "Cannot leave gen2 allocation without entering it");
tc->allocate_in_gen2--;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment