The size of Unknown should be ty_size, otherwise when it is encountered, we never advance the cursor and it creates an infinite loop. Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
@@ -154,7 +154,7 @@ impl BtfType {
use BtfType::*;
match self {
- Unknown => 0,
+ Unknown => ty_size,
Fwd(_) | Const(_) | Volatile(_) | Restrict(_) | Ptr(_) | Typedef(_) | Func(_)
| Float(_) => ty_size,
Int(_, _) => ty_size + mem::size_of::<u32>(),