Patrik Stridvall wrote:

> +print '    #stdcall_name ":\n"' . " \\\n";=0A=
> +print '    "\tmovl (%esp), %eax\n"' . " \\\n";=0A=
> +print '    "\tleal " #argsize "(%esp), %edx\n"' . " \\\n";=0A=
> +print '    "." #stdcall_name ":\n"' . " \\\n";=0A=
> +print '    "\tmovl (%edx), %ecx\n"' . " \\\n";=0A=
> +print '    "\tmovl %eax, (%edx)\n"' . " \\\n";=0A=
> +print '    "\tmovl %ecx, %eax\n"' . " \\\n";=0A=
> +print '    "\tsubl $4, %edx\n"' . " \\\n";=0A=
> +print '    "\tleal (%esp), %ecx\n"' . " \\\n";=0A=
> +print '    "\tcmpl %ecx, %edx\n"' . " \\\n";=0A=
> +print '    "\tjge ." #stdcall_name "\n"' . " \\\n";=0A=
[snip]
> +print '    "\tpopl %ecx\n"' . " \\\n";=0A=
> +print '    "\tsubl $" #argsize ", %esp\n"' . " \\\n";=0A=
> +print '    "\tjmp *%ecx\n"' . " \\\n";=0A=

This appears to be broken;  you need to *add* the argsize instead
of subtracting it, and furthermore the return address lies now
*above* the arguments after the stack permutation you did above ;-)

What about this instead of the last three lines:

  print "\taddl $" #argsize ", %esp\n";
  print "\tret\n";


Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  [EMAIL PROTECTED]

Reply via email to