Skip to content

Instantly share code, notes, and snippets.

@mlschroe
Created September 20, 2011 14:05
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 mlschroe/1229149 to your computer and use it in GitHub Desktop.
Save mlschroe/1229149 to your computer and use it in GitHub Desktop.
diff --git a/src/binder/container.c b/src/binder/container.c
index d0d047e..6ae05c3 100644
--- a/src/binder/container.c
+++ b/src/binder/container.c
@@ -64,6 +64,10 @@ void Rakudo_cont_store(PARROT_INTERP, PMC *cont, PMC *value,
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
"Cannot assign a non-Perl 6 value to a Perl 6 container");
+ if (PMC_IS_NULL(cont)) {
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ "Cannot assign into a PMCNULL container");
+ }
/* If it's a scalar container, optimized path. */
if (STABLE(cont)->WHAT == scalar_type) {
Rakudo_Scalar *scalar = (Rakudo_Scalar *)PMC_data(cont);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment