flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > HEAP keyword broken? (64-bit)

Author
Thread Post new topic Reply to topic
bitRAKE



Joined: 21 Jul 2003
Posts: 4043
Location: vpcmpistri
bitRAKE 31 Mar 2013, 14:06
Code:
format PE64 GUI 5.0
;       Reserve,        Commit
stack   $10000,         $10000
heap    $10000,         $10000

retn    
stack seems to work and I'm sure heap worked in the past. Now it just crashes FASM.

Just broken for 64-bit.

32-bit seem fine.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 31 Mar 2013, 14:06
View user's profile Send private message Visit poster's website Reply with quote
nts94



Joined: 10 Jun 2012
Posts: 11
nts94 02 Apr 2013, 21:48
Well, the problem is in FORMATS.INC, near peplus_heap label. The only difference between the 32 bit and the 64 bit is that edx gets trashed in the later, and then it crashed when "cmp eax,[edx+70h]" is executed at line 1545.

Comparing that routine with peplus_stack, it seems that edx is mistaken, it should be ecx (but I could be wrong, I'm not very comfortable with fasm sources yet)
Post 02 Apr 2013, 21:48
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4043
Location: vpcmpistri
bitRAKE 02 Apr 2013, 22:24
Code:
        cmp     edx,[ecx+74h]
        ja      value_out_of_range
        jb      instruction_assembled
        cmp     eax,[edx+70h]
        ja      value_out_of_range
        jmp     instruction_assembled    
Yeah. it looks like a 64-bit comparison with an incorrect pointer being used for the low dword. Good catch.
Post 02 Apr 2013, 22:24
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 03 Apr 2013, 12:31
Thank you for finding this out. I'm applying the correction to 1.71.10 release (coming soon).
Post 03 Apr 2013, 12:31
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 03 Apr 2013, 14:02
Tomasz Grysztar
You might want to include a fix for the following one either.
Code:
;should display 'a', but fails with undefined instruction
struc x { display .,13,10 }
'a' x    


It is related to the bug I reported before, which IMHO was not completely resolved.

_________________
Faith is a superposition of knowledge and fallacy
Post 03 Apr 2013, 14:02
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 03 Apr 2013, 14:12
The invocation of "struc" macro needs to have a valid name token as a label - no other token (or combination of tokens) is allowed there.
Code:
macro x { display 13,10 }
struc x { display `.,13,10 }

x ; valid invocation of macro
a: x ; another valid invocation of macro
a x ; valid invocation of struc
'a' x ; not an invocation of either     


If you want to report new bugs, please create new topic for each report - the moderator will make it sticky when it's valid.
Post 03 Apr 2013, 14:12
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 03 Apr 2013, 14:17
Tomasz Grysztar
Well. Because this one had a potential to initiate a discussion, I didn't want to report it, until I have more free time. Smile
Quote:
If you want to report new bugs, please create new topic for each report - the moderator will make it sticky when it's valid.

OK. I hoped one post would be enough, but obviously I will need to create a separate topic for multiple deficiencies.

_________________
Faith is a superposition of knowledge and fallacy
Post 03 Apr 2013, 14:17
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386 04 Apr 2013, 01:45
> Thank you for finding this out. I'm applying the correction to 1.71.10 release (coming soon).

It's out:

Code:
version 1.71.10 (Apr 03, 2013)

[-] Fixed a crashing "heap" directive in 64-bit PE format.
    


Tomasz Grysztar wrote:
If you want to report new bugs, please create new topic for each report - the moderator will make it sticky when it's valid.


Could you please also look at: http://board.flatassembler.net/topic.php?t=15279 (sugg, not BUG)

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 04 Apr 2013, 01:45
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.