tag 195364 +upstream
thanks

I have looked at this Debian bug (http://bugs.debian.org/195364). The problem 
seems to be at line 599 of gforth's engine/main.c, which states

      pi->length = symbols1[i+1]-symbols1[i];

symbols[] is an array of consecutive(?) label addresses, and GCC 3.3 happily 
inverts their order when compiling engine/engine.c(prim.i). Thus the length 
ends up being negative, and the next memcpy() which uses it (in 
append_prim()) causes a segfault.

The proper solution seems to be not to copy the built-in functions in the 
first place. I wonder why that is done -- I consider that to be rather 
dangerous if the compiler happens to do CSE or similar optimizations.

Unfortunately I am not fluent enough with the gforth internals to change that.


NB: If this analysis is completely out of whack, I'll happily appreciate 
corrections.
-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  [EMAIL PROTECTED]
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
-- 
The avocation of assessing the failures of better men can be turned
into a comfortable livelihood, providing you back it up with a Ph.D.
                -- Nelson Algren, "Writers at Work"


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to