We were struggling with some memory corruption seen mainly in tcl [1]
since quite a time.
I think, I've found it now, thanks to an example Matt has pasted this
morning.
The reason is:
- there is a hard limit of 256 macros
- this was marked with XXX but *not checked*
- each .include 'foo' with macros inside does *append* to the macro list
and worse:
- even if the macro already exists, it's just appended
- the list of macros is AFAIK never cleared
For now I've put in a check for this limit and throw an
internal_exception, if necessary (r10568).
Before putting further effort into that macro stuff I'd rather have
clarified:
- what is the scope of macros
- shouldn't we have an external macro pre-processor
Compiler writers can currently work around by:
.include 'file with .const <type> = ..' always
.include 'file with .constant'.pasm once
.include 'file with .macro' once
(yes that is a mess)
leo
[1] guess which tcl tests are failing now - yes:
cmd_break.t 1-2
cmd_continue.t 1-2