Re: Compiler crash?
- Posted by Robert Craig <rds at RapidEuphoria.com> Jun 07, 2005
- 510 views
puts(1, c_func(up, {rand("abcdefghijklmnopqrstuv") + ' '}) & '\n')
I've had time to pin it down now. The bug is caused because the Translator assumes that c_func() must always return an atom. This used to be true a few years ago, and is still true if you only call C-coded functions in .dlls. However it is possible to call a Euphoria-coded function in a .dll, and that function might be one that returns a sequence. Above, the translator uses this bad assumption and produces incorrect code for the concatenation step. If you assign the result of c_func() to a variable, or if your Euphoria function does in fact return an atom, there shouldn't be a problem. Also, in the example above, you could split the statement into two simpler statements. In more complicated expressions, bad C code could result. I'll fix it for the next release. It's just a one-line change. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com