More bug fixes

This commit is contained in:
Carl Lerche
2017-06-13 13:46:45 -07:00
parent ef495d55dc
commit c7de880f6c
3 changed files with 188 additions and 66 deletions

View File

@@ -134,6 +134,7 @@ impl Encoder {
{
match *index {
Index::Indexed(idx, _) => {
debug_assert!(self.table.len() + 62 > idx, "table={}; index={}", self.table.len(), idx);
let header = self.table.resolve(&index);
try!(encode_int(idx, 7, 0x80, dst));
}
@@ -163,6 +164,7 @@ impl Encoder {
try!(encode_str(header.value_slice(), dst));
}
Index::InsertedValue(idx, _) => {
debug_assert!(self.table.len() + 62 > idx, "table={}; index={}", self.table.len(), idx);
let header = self.table.resolve(&index);
assert!(!header.is_sensitive());