tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Re: stdcall support


From: Fabrice Bellard
Subject: Re: [Tinycc-devel] Re: stdcall support
Date: Thu, 09 Oct 2003 01:18:00 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

Thomas Harning Jr. wrote:
I found that the issue is EXACTLY that the stdcall function calling matter is not being done.

I added the code
[code]
__asm__( "pushl %ebp\n\t"
    "pushl %ebp\n\t"
    "pushl %ebp\n\t"
    "pushl %ebp\n\t"
    "pushl %ebp\n\t" );
[/code]
before one of the functions that required 5 input variables and it worked [along with all the other code, I did the same before each]. I just used %ebp just because that was in the code i cut.

The reason this works is because with normal cdecl calls, the caller cleans up the stack, not the function [which is how stdcall works], so TCC is generating code to pop off the data after the function is called, but since the stdcall function already did that, its popping off stuff it shouldn't which causes the subprogram to spiral downward into a crash.

Strange. stdcalls used to work in TCC. I am going to check it.

Fabrice.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]