cecil and no_dispatch.e

2 messages Options
Embed this post
Permalink
Jörgen Tegnér

cecil and no_dispatch.e

Reply Threaded More More options
Print post
Permalink
Hi,

some time after last summer code was changed to generate code like below
for one class where I use cecil.
On line XXX, the error is C->id, where C is a void pointer. A cast to
T0* seems in place.
I don't have a small example to show this but hope the snippet is enough
to find a fix or workaround.

T5 e_quadpack_func(void* C,T5 a1){
T5 R;
#ifndef FIXED_STACK_BOTTOM
int valid_stack_bottom = stack_bottom != NULL;
#endif
se_dump_stack ds={NULL,NULL,0,NULL,NULL,NULL};
ds.caller=se_dst;
ds.exception_origin=NULL;
ds.locals=NULL;
set_dump_stack_top(&ds);/*link*/
#ifndef FIXED_STACK_BOTTOM
if(!valid_stack_bottom) stack_bottom =
(void**)(void*)&valid_stack_bottom;
#endif
ds.p=0xFFF80009/*l4c0/cecil.se*/;
if((/*no_dispatch.e*/C)==((void*)((void*)0))){  
internal_exception_handler(Void_call_target);
}
if((((/*no_dispatch.e*/C)->id))!=(INT8_C(49))){ // <-- XXX    
internal_exception_handler(System_level_type_error);
}
R=r49eiffel_callback(&ds,((T49*)/*no_dispatch.e*/C),a1);
#ifndef FIXED_STACK_BOTTOM
if(!valid_stack_bottom) stack_bottom = NULL;
#endif
set_dump_stack_top(ds.caller);/*unlink*/
return R;
}/*--*/


/Jörgen

Jörgen Tegnér

Re: cecil and no_dispatch.e

Reply Threaded More More options
Print post
Permalink
Below is a patch for trunk/tools/expression/no_dispatch.e. It works for
me.

/Jörgen

--- no_dispatch.e.orig 2009-02-12 22:03:15.000000000 +0100
+++ no_dispatch.e 2009-02-12 22:33:13.000000000 +0100
@@ -100,7 +100,7 @@
 
  compile_to_c (type: TYPE) is
  do
- cpp.pending_c_function_body.append(once "/*no_dispatch.e*/")
+ cpp.pending_c_function_body.append(once "/*no_dispatch.e*/ (T0*)")
  side_effect_free_expression.compile_to_c(type)
  end