Forward reference bug: was Re: ver. 4.0 WIN98 Binaries
- Posted by jimcbrown (admin) Sep 13, 2008
- 1522 views
Thanks Jim:
I finally found what was crashing the system but was not reporting the error.
If you run this simple program on WIN98
It will crash the system.
Same crash on linux. I was able to find the bug in the parser using int.ex
Note that PreDefList sequence is not declared and
the parser is not detecting it.
Yes, this is a forward reference bug.
The parser emits an opcode to state that this is a forward reference that will need to be backpatched later, but then the RHS_SUBS opcode immediately attempts to reference the variable before the parser has had a chance to attempt to backpatch it. (If it had gotten that chance, then this would have just been a simple and easy "variable not declared" error.)
I've fixed it and I'm about to check this in, but I may have discovered another bug. Need to check with Matt L about this one.
-- junk.ew -- sequence dscrip dscrip = PreDefList[1] if getc(0) then end if -- end of junk.ew --
-- junk.ew -- sequence dscrip dscrip = PreDefList[1] if getc(0) then end if sequence PreDefList -- end of junk.ew --
That now comes up with PreDefList being an unresolved forward reference. Is that right??
If it is made a global sequence, then the parser succeeds and we get the obvious runtime error (of PreDefList not having a value).