diff --git a/src/util/register_allocate.c b/src/util/register_allocate.c index 83686feb62c..d9686d20534 100644 --- a/src/util/register_allocate.c +++ b/src/util/register_allocate.c @@ -454,6 +454,8 @@ ra_set_deserialize(void *mem_ctx, struct blob_reader *blob) for (unsigned int c = 0; c < class_count; c++) { struct ra_class *class = rzalloc(regs, struct ra_class); regs->classes[c] = class; + class->regset = regs; + class->index = c; class->regs = ralloc_array(class, BITSET_WORD, BITSET_WORDS(reg_count)); blob_copy_bytes(blob, class->regs, BITSET_WORDS(reg_count) * diff --git a/src/util/tests/register_allocate_test.cpp b/src/util/tests/register_allocate_test.cpp index de463954abf..498985e4933 100644 --- a/src/util/tests/register_allocate_test.cpp +++ b/src/util/tests/register_allocate_test.cpp @@ -212,7 +212,7 @@ TEST_F(ra_test, aligned_contigregs) } } -TEST_F(ra_test, DISABLED_serialization_roundtrip) +TEST_F(ra_test, serialization_roundtrip) { struct blob blob; blob_init(&blob);