flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Compiler Internals > Unhandled exception at 0x004028CB in fasmg.exe: 0xC0000005

Author
Thread Post new topic Reply to topic
zhak



Joined: 12 Apr 2005
Posts: 453
Location: Belarus
Unhandled exception at 0x004028CB in fasmg.exe: 0xC0000005
The below code causes Unhandled exception at 0x004028CB in fasmg.exe: 0xC0000005: Access violation reading location 0x002DA7FD.

The problem is in calling store from store

Code:

true  := 1
false := 0

struct MY
  a rw 1
end struct

_my MY a'a'

macro struct? name

  struc rb? n
    label .
    rb n
    .__length = $ - .
    .__size = 1
  end struc

  struc rw? n
    label .
    rw n
    .__length = $ - .
    .__size = 2
  end struc

  macro store namevaluei
    virtual at 0
      dbx .name.__lengthvalue
      len = $ - i * .name.__size
    end virtual
    store value:len at .name + i * .name.__size
  end macro

  macro end?.struct?!
      end namespace
      irp defargs
        local paramvalueilenis_seq
        value equ
        i = 0
        len = 0
        is_seq = false
        match name:valuedef
          store namevaluei
        end match
      end irp
    end struc
    virtual at 0
      name name
      sizeof.name = $
    end virtual
    purge end?.struct?
  end macro

    struc name args&
      label .:sizeof.name
      namespace .
end macro


Post 11 Feb 2017, 01:03
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6252
Location: Kraków, Poland
Thank you for the report, it is fixed now.

You have an infinite recursion there and it helped uncover a rarely occurring bug. To avoid the recursion you should either define the STORE macro as case-insensitive symbol ("macro store?") or call the original store macro with "store?" identifier to choose the original case-insensitive over the case-sensitive one.
Post 11 Feb 2017, 12:52
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.