PR# 16228 Wrong usage of ARRAYED_LIST in {EV_FIGURE}.default_create
Problem Report Summary
Submitter: maverick
Category: EiffelVision
Priority: Medium
Date: 2009/09/04
Class: Bug
Severity: Serious
Number: 16228
Release: 6.4.7.9451
Confidential: No
Status: Open
Responsible:
Environment: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
Synopsis: Wrong usage of ARRAYED_LIST in {EV_FIGURE}.default_create
Description
This is a problem with the version of Vision2 delivered in the experimental directory of EiffelStudio.
This is a snippet from {EV_FIGURE}.default_create. I only kept the lines which are important.
do
-- ...
create points.make (0)
points.resize (point_count)
-- ...
from
n := 1
l_object_id := object_id
until
n > point_count
loop
-- ...
points.put_i_th (p, n)
-- ...
n := n + 1
end
end
The problematic line is "points.put_i_th (p, n)". At its first execution, `points' is guaranteed to be empty while the precondition of {ARRAY_LIST}.put_i_th states that the provided index (in this case n) should be a valid index. It should probably be replaced by a call to {ARRAY_LIST}.extend.
Thank you!
Simon
To Reproduce
Problem Report Interactions