-
-
Save jnthn/c42ed1caa3f7ff0ac073 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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