mirror of https://github.com/m-labs/artiq.git
firmware: Fix kernel RPC tuple size calculation (memory corruption)
Test case to follow.
This commit is contained in:
parent
fc95183e04
commit
b8ff627be9
|
@ -260,8 +260,9 @@ mod tag {
|
||||||
Tag::ByteArray => 8,
|
Tag::ByteArray => 8,
|
||||||
Tag::Tuple(it, arity) => {
|
Tag::Tuple(it, arity) => {
|
||||||
let mut size = 0;
|
let mut size = 0;
|
||||||
|
let mut it = it.clone();
|
||||||
for _ in 0..arity {
|
for _ in 0..arity {
|
||||||
let tag = it.clone().next().expect("truncated tag");
|
let tag = it.next().expect("truncated tag");
|
||||||
size += tag.size();
|
size += tag.size();
|
||||||
}
|
}
|
||||||
size
|
size
|
||||||
|
|
Loading…
Reference in New Issue