flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > [fasmg] Error: exceeded the maximum allowed depth of stack.

Author
Thread Post new topic Reply to topic
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 29 Mar 2017, 22:27
This error I got with my crooked hands and invalid input Smile

Code:
struc named_datatype type*, args&
  label . : type
  type args
  .__length = $ - .
end struc

struc byte? args&
  named_datatype byte, args
end struc

vars byte 0x30
    
Post 29 Mar 2017, 22:27
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 29 Mar 2017, 22:32
Although not sure if it needs to be addressed
Post 29 Mar 2017, 22:32
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 30 Mar 2017, 09:21
This limit was put in there in order to detect infinite recursion. Since your code contains one, we can say that the safety measure worked correctly. Smile

If you ever hit the limit while there is no infinite recursion, keep in mind that you can adjust the limit from the command line.
Post 30 Mar 2017, 09:21
View user's profile Send private message Visit poster's website Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 30 Mar 2017, 13:14
The above code prints lots of garbage to console prior to error message, when assembled. Maybe this could be tuned somehow to be avoided?
Post 30 Mar 2017, 13:14
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 30 Mar 2017, 13:21
zhak wrote:
The above code prints lots of garbage to console prior to error message, when assembled. Maybe this could be tuned somehow to be avoided?
It's not exactly a garbage, it is a complete report of source context where the error happened, formatted consistently with the usual fasm's method of showing where and what line was assembled when the error was encountered. I could skip this and display only the error message like in the case of "out of memory" error, but here showing the line can be actually helpful, because it demonstrates where the infinite recursion happened and what macro/file got processed recursively.
Post 30 Mar 2017, 13:21
View user's profile Send private message Visit poster's website 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.