Skip to content

Commit

Permalink
runtime: fix serialization of object lists.
Browse files Browse the repository at this point in the history
Fixes #500.
whitequark committed Jul 7, 2016
1 parent 5a79fcf commit 653eeb4
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion artiq/runtime/session.c
Original file line number Diff line number Diff line change
@@ -877,7 +877,12 @@ static int send_rpc_value(const char **tag, void **value)

case 'O': { // host object
struct { uint32_t id; } **object = *value;
return out_packet_int32((*object)->id);

if(!out_packet_int32((*object)->id))
return 0;

*value = (void*)((intptr_t)(*value) + sizeof(*object));
break;
}

default:
3 changes: 3 additions & 0 deletions artiq/test/coredevice/test_embedding.py
Original file line number Diff line number Diff line change
@@ -48,6 +48,9 @@ def test_object(self):
obj = object()
self.assertRoundtrip(obj)

def test_object_list(self):
self.assertRoundtrip([object(), object()])


class _DefaultArg(EnvExperiment):
def build(self):

0 comments on commit 653eeb4

Please sign in to comment.