A possible code generation issue

Dibyendu Majumdar mobile@majumdar.org.uk
Thu Jan 1 00:00:00 GMT 2015


On 6 July 2015 at 22:29, Dibyendu Majumdar <mobile@majumdar.org.uk> wrote:
> BTW the dump of types is problematic in many ways:
> 1) types are in wrong order
> 2) function types are incorrectly output
> 3) array types are incorrectly output
> 4) in one case as least a pointer was missing.

Apologies the last point (4) was actually due to a bug in my code -
but here is what happened.

t->lua_longjumpT = gcc_jit_context_new_opaque_struct(ravi->context, NULL,
"ravi_lua_longjmp");
t->plua_longjumpT = gcc_jit_struct_as_type(t->lua_longjumpT);

The plua_longjmpT was meant to be a pointer to the struct.

Surprisingly I was able to use the incomplete type in another struct!
I think this just goes to show that you need to have some form of
run-time type assertion to detect such issues.

Regards

Dibyendu



More information about the Jit mailing list