Skip to content

Commit

Permalink
Add a sanity check to catch an error, rather than SEGVin'.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Feb 12, 2012
1 parent 5641529 commit 046bd1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/6model/serialization.c
Expand Up @@ -619,6 +619,9 @@ static void serialize_object(PARROT_INTERP, SerializationWriter *writer, PMC *ob
/* Get index of SC that holds the STable and its index. */
Parrot_Int4 sc;
Parrot_Int4 sc_idx;
if (obj->vtable->base_type != smo_id)
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
"Non-6model object in object serialization list");
get_stable_ref_info(interp, writer, STABLE_PMC(obj), &sc, &sc_idx);

/* Ensure there's space in the objects table; grow if not. */
Expand Down

0 comments on commit 046bd1d

Please sign in to comment.