Skip to content

Commit 653eeb4

Browse files
author
whitequark
committedJul 7, 2016
runtime: fix serialization of object lists.
Fixes #500.
1 parent 5a79fcf commit 653eeb4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
 

Diff for: ‎artiq/runtime/session.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,12 @@ static int send_rpc_value(const char **tag, void **value)
877877

878878
case 'O': { // host object
879879
struct { uint32_t id; } **object = *value;
880-
return out_packet_int32((*object)->id);
880+
881+
if(!out_packet_int32((*object)->id))
882+
return 0;
883+
884+
*value = (void*)((intptr_t)(*value) + sizeof(*object));
885+
break;
881886
}
882887

883888
default:

Diff for: ‎artiq/test/coredevice/test_embedding.py

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ def test_object(self):
4848
obj = object()
4949
self.assertRoundtrip(obj)
5050

51+
def test_object_list(self):
52+
self.assertRoundtrip([object(), object()])
53+
5154

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

0 commit comments

Comments
 (0)
Please sign in to comment.