Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created October 3, 2013 22:46
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/6818287 to your computer and use it in GitHub Desktop.
Save jnthn/6818287 to your computer and use it in GitHub Desktop.
diff --git a/src/6model/reprs/P6opaque.c b/src/6model/reprs/P6opaque.c
index acbfa96..db21971 100644
--- a/src/6model/reprs/P6opaque.c
+++ b/src/6model/reprs/P6opaque.c
@@ -383,6 +383,8 @@ static void bind_attribute(MVMThreadContext *tc, MVMSTable *st, MVMObject *root,
break;
}
case MVM_reg_str: {
+ if (value_reg.s && ((MVMObject *)value_reg.s)->st->REPR->ID != MVM_REPR_ID_MVMString)
+ MVM_exception_throw_adhoc(tc, "P6opaque: string is not a string");
if (attr_st)
attr_st->REPR->box_funcs.set_str(tc, attr_st, root,
(char *)data + repr_data->attribute_offsets[slot],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment