Re: ver 4.0 c_func problem on WIN98 Here Is proof of the problem !
- Posted by jimcbrown (admin) Apr 22, 2009
- 1218 views
jimcbrown said...
I added some debug code to call_c() (nothing but printf()s) and suddenly the code is working correctly.
This sounds like an optimization bug.
If you are unable to use patch, the entire file (source/be_callc.c) is available at http://euphoria.pastey.net/112882
But, as you can see from the diff, the only changes required to make it work are 3 printf() statements.
--- ../feu3/source/be_callc.c 2009-04-08 14:04:05.000000000 -0400 +++ /tmp/fl/eu40/source/be_callc9.c 2009-04-22 23:26:38.000000000 -0400 @@ -118,6 +118,7 @@ if (IS_ATOM(arg_list)) { RTFatal("c_proc/c_func: argument list must be a sequence"); } + printf("ha! %d\n", proc_index); arg_list_ptr = SEQ_PTR(arg_list); next_arg_ptr = arg_list_ptr->base + arg_list_ptr->length; @@ -277,11 +278,13 @@ #if defined(EWINDOWS) && !defined(EWATCOM) if (cdecl_call) { iresult = (*((int ( __cdecl *)())int_proc_address))(); + printf("iresult cdecl %d %d %d %x\n", iresult, proc_ind ex, func, return_type); pop(); } else #endif iresult = (*((int (__stdcall *)())int_proc_address))(); + printf("iresult stdcall %d %d %d %x\n", iresult, proc_i ndex, func, return_type); #ifdef EUNIX pop(); #endif