tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] BUG: called function should pop the arguments when us


From: 张博洋
Subject: Re: [Tinycc-devel] BUG: called function should pop the arguments when using fastcall
Date: Thu, 24 Aug 2017 00:01:38 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

Hello,

I searched 'fastcall' in git history, and I found that FUNC_FASTCALLW was implemented in this commit at 2005.


 windows style fastcall (Filip Navara)
commit  e9c64e3f473a29324988169f7fcffeff49649a96
author  bellard <bellard> 
        Sun, 4 Sep 2005 06:21:22 +0800 (3 22:21 +0000)
committer       bellard <bellard> 
        Sun, 4 Sep 2005 06:21:22 +0800 (3 22:21 +0000)
tree    9d1098f4de5f8f61646b5d43ad0f627181b2c0b4        tree | snapshot (tar.gz 
zip)
parent  81f957ae09642e4b8425c830a3444b464fb4aae4        commit | diff
windows style fastcall (Filip Navara)
i386-gen.c              diff | blob | blame | history
tcc.c           diff | blob | blame | history


The fastcall was intended to be windows-style in this commit. However, nobody notice the stack-maintenance was wrong in the last 12 years.



Zhang Boyang



在 2017年08月23日 20:42, grischka 写道:
张博洋 wrote:
Hello,

I found that TCC implement 'fastcall' that the calling function pops arguments. However, according to MSDN (https://msdn.microsoft.com/en-us/library/6xa169sk.aspx), the called function should pop arguments when using fastcall. I provided a patch and I have already pushed it to the mob branch, since I'm new to TCC and compilers, please review my patch carefully. I also wrote a test case which is in attachments, you may use the testcase to discover the problem.

Did someone try this on Linux?  The wanted behavior might be different.

-- gr


  Thanks

Zhang Boyang

_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel



reply via email to

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