diff options
-rw-r--r-- | src/types.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/types.rs b/src/types.rs index d16ee4df..9acf942e 100644 --- a/src/types.rs +++ b/src/types.rs @@ -193,7 +193,9 @@ impl Type { TArray(_, _, l) => l.clone(), TComp(ref ci) => ci.borrow().layout.clone(), TEnum(ref ei) => ei.borrow().layout.clone(), - TNamed(ref ti) => return ti.borrow().ty.layout(), + // Test first with the underlying type layout, else with the reported one + // This fixes a weird bug in SM when it can't find layout for uint32_t + TNamed(ref ti) => ti.borrow().ty.layout().unwrap_or(ti.borrow().layout.clone()), TVoid | TFuncProto(..) | TFuncPtr(..) => return None, |