tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Re: stdcall support


From: Thomas Harning Jr.
Subject: [Tinycc-devel] Re: stdcall support
Date: Tue, 07 Oct 2003 20:07:08 -0400

I found that the issue is EXACTLY that the stdcall function calling matter is not being done.

I added the code
__asm__(
                "pushl %ebp\n\t"
                "pushl %ebp\n\t"
                "pushl %ebp\n\t"
                "pushl %ebp\n\t"
                "pushl %ebp\n\t"
                );
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.

reply via email to

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