Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Language/Dynamic Arrays    [ Add a report in this area ]  
Report #:  17638   Status: Closed
(Pulled) Copy function does not check to make sure the source array is non-nil before trying to get its length.
Project:  Delphi Build #:  5.0
Version:    5.0 Submitted By:   John Kaster
Report Type:  Basic functionality failure Date Reported:  1/18/1999 12:00:00 AM
Severity:    Infrequently encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All versions Internal Tracking #:   44870
Resolution: Fixed (Resolution Comments) Resolved in Build: : 10.0.2098.14501
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
Copy function does not check to make sure the source array is non-nil before trying to get its length.
Steps to Reproduce:
dcc32 -cc 44870.pas
44870.exe
Result:
Runtime error 216 at 00003272

--- original text ---
Use below code to see the AV. I think there should be some sort of check for this....?

type
  TA = Array of integer;

procedure Test;
var
  A1, A2: TA;
begin
  A2:= nil;
  A1:= Copy(A2); // AV here
end;

Workarounds
None
Attachment
N
Comments

None

Server Response from: ETNACODE01