Skip to content

Commit

Permalink
Merge pull request #362 from pmurias/fix-uncomposed-segfault
Browse files Browse the repository at this point in the history
Fix segfault when composing an uncomposed P6opaque repr.
  • Loading branch information
jnthn committed Apr 23, 2016
2 parents 0f408f9 + e3bf435 commit 629282f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/6model/reprs/P6opaque.c
Expand Up @@ -879,7 +879,7 @@ static void serialize_repr_data(MVMThreadContext *tc, MVMSTable *st, MVMSerializ
MVMP6opaqueREPRData *repr_data = (MVMP6opaqueREPRData *)st->REPR_data;
MVMuint16 i, num_classes;

if (!repr_data->name_to_index_mapping)
if (!repr_data)
MVM_exception_throw_adhoc(tc,
"Representation must be composed before it can be serialized");

Expand Down Expand Up @@ -1082,7 +1082,7 @@ static void serialize(MVMThreadContext *tc, MVMSTable *st, void *data, MVMSerial
MVMuint16 num_attributes = repr_data->num_attributes;
MVMuint16 i;

if (!repr_data->name_to_index_mapping)
if (!repr_data)
MVM_exception_throw_adhoc(tc,
"Representation must be composed before it can be serialized");

Expand Down

0 comments on commit 629282f

Please sign in to comment.