object-introspection
object-introspection copied to clipboard
OID produces incorrect results when top level argument is a pointer
The top level pointer attribute is omitted when traced with OID. That is, the argument is treated as an argument of the underlying data type. For example:
Actual output:
[
{
"name": "a0",
"typePath": "a0",
"typeName": "int",
"isTypedef": false,
"staticSize": 4,
"dynamicSize": 0
}
]
Expected output:
[
{
"typeName": "int *",
"staticSize": 8,
"dynamicSize": 4,
"pointer": XXX,
"members": [
{
"typeName": "int",
"staticSize": 4,
"dynamicSize": 0
}
]
}
]
### Affected tests:
-
OidIntegration.pointers_int -
OidIntegration.pointers_no_follow -
OidIntegration.pointers_int_null -
OidIntegration.pointers_void -
OidIntegration.pointers_void_no_follow -
OidIntegration.pointers_void_null -
OidIntegration.pointers_vector -
OidIntegration.pointers_vector_no_follow -
OidIntegration.pointers_vector_null
-
OidIntegration.pointers_void -
OidIntegration.pointers_void_no_follow -
OidIntegration.pointers_void_null
Are special cases of this. As oid codegen sees them as the underlying type (void when it should be void*) it hits: https://github.com/facebookexperimental/object-introspection/blob/1c3ee5bf6b79676bce4155284f3723de42b2227e/src/OICodeGen.cpp#L1025-L1028