microsoft / ifc-spec

IFC format specification
Creative Commons Attribution 4.0 International
71 stars 7 forks source link

TypeSort::Placeholder has surprising interior padding following "basis" #78

Open DarkArc opened 1 year ago

DarkArc commented 1 year ago

The IFC spec describes TypeSort::Placeholder as:

|-------------|-----------------------------|
| Name        | Type                        |
|-------------|-----------------------------|
| constraint  | ExprIndex                   |
| basis       | TypeBasis                   |
| elaboration | TypeIndex                   |
|-------------|-----------------------------|

The true representation is:

|-------------|-----------------------------|
| Name        | Type                        |
|-------------|-----------------------------|
| constraint  | ExprIndex                   |
| basis       | TypeBasis                   |
| __pading__  | uint8[3]                    |
| elaboration | TypeIndex                   |
|-------------|-----------------------------|

Ideally, this would be as follows to match other cases of padding in the IFC spec:

|-------------|-----------------------------|
| Name        | Type                        |
|-------------|-----------------------------|
| constraint  | ExprIndex                   |
| basis       | TypeBasis                   |
| elaboration | TypeIndex                   |
| __pading__  | uint8[3]                    |
|-------------|-----------------------------|

At a minimum, this padding should be documented in the spec.