[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Would you consider this a bug?

muswick@uhrad.com writes:

> Actually I don't think it is a bug.  One needs to carefully review
> how IDL handles arrays and indices.

An artifact not mentioned in the language description is a bug.
Imagining how this bug might come about does not make it go away.

> If we go back to the original posted question:
> > a = [3,4,5]
> > a[[2,1,0]] = a
> > a will be set to [3,4,3]
> Which is correct, based on 'a' being overwritten.  This is avoid huge memory
> overhead in many cases where the right side equation is complex.

It is a reasonable optimization in general, but an optimization that
changes the results of the command is a bug.  Being able to understand
how this bug comes about does not make it "correct".  IDL needs to
find out where this optimization is inappropriate and not do it where
harm does ensue.

You cannot define correctness of a program based on the artifacts of
some optimizer.  An optimizer has to work behind the scenes.

David Kastrup                                     Phone: +49-234-700-5570
Email: dak@neuroinformatik.ruhr-uni-bochum.de       Fax: +49-234-709-4209
Institut für Neuroinformatik, Universitätsstr. 150, 44780 Bochum, Germany