Blank out value on LatestMap decode insert

Fixing a rare case that came up in a test. In order for this to cause
a problem, the data being decoded has to have entries out of order,
and have a value that is nil or omitted.
This commit is contained in:
Bryan Boreham
2018-02-26 10:34:49 +00:00
parent 44076048ca
commit f17640646e
3 changed files with 33 additions and 1 deletions

View File

@@ -143,6 +143,7 @@ function generate_latest_map() {
if i == len(*m) || (*m)[i].key != key {
*m = append(*m, ${entry_type}{})
copy((*m)[i+1:], (*m)[i:])
(*m)[i] = ${entry_type}{}
}
return i
}