2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 03:08:27 +08:00

runtime: fix serialization of object lists.

Fixes #500.
This commit is contained in:
whitequark 2016-07-07 12:40:50 +00:00
parent 5a79fcf9ba
commit 653eeb476f
2 changed files with 9 additions and 1 deletions

View File

@ -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:

View File

@ -48,6 +48,9 @@ class RoundtripTest(ExperimentCase):
obj = object()
self.assertRoundtrip(obj)
def test_object_list(self):
self.assertRoundtrip([object(), object()])
class _DefaultArg(EnvExperiment):
def build(self):