Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created August 29, 2014 17:34
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/5d262012b7745ae40fc5 to your computer and use it in GitHub Desktop.
Save jnthn/5d262012b7745ae40fc5 to your computer and use it in GitHub Desktop.
diff --git a/src/gc/roots.c b/src/gc/roots.c
index 42892c0..5452697 100644
--- a/src/gc/roots.c
+++ b/src/gc/roots.c
@@ -371,6 +371,8 @@ static void scan_registers(MVMThreadContext *tc, MVMGCWorklist *worklist,
type_map = frame->static_info->body.local_types;
count = frame->static_info->body.num_locals;
}
+if (count * sizeof(MVMRegister) > frame->allocd_work)
+ MVM_panic(1, "FAIL");
for (i = 0; i < count; i++)
if (type_map[i] == MVM_reg_str || type_map[i] == MVM_reg_obj)
MVM_gc_worklist_add(tc, worklist, &frame->work[i].o);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment