Project

General

Profile

Bug #4971

Object array resize

Added by Marian Edu over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:

History

#1 Updated by Greg Shah over 3 years ago

  • Description updated (diff)

From Marian:

When an non-fixed extent variable of type object is resized the actual object type previously saved in dynamicArrayType is reset in ArrayAssigner (line 1125), the comment on that being the type is not needed anymore.

Problem is, such variable can be set back to a non-fixed extent using unknown/null as input to extent function and then it can be set to another fix extent and so on, there is no limit on how many time the variable can be moved from undetermined to fixed size and back. The issue being, the next time when the array is resized the object type is no longer known and we and-up with an object that has no type - this leads to NPE when assigned later on.

Attempted a fix in 4384g rev 11706 but maybe I'm missing something here so better to double check...

The test that was failing for us: oo/openedge/core/assert/object.p

#2 Updated by Greg Shah over 3 years ago

  • Assignee set to Constantin Asofiei

#3 Updated by Constantin Asofiei over 3 years ago

The fix in 4384g rev 11706 looks OK - when resizing to zero, the type is extracted from the array's first element and saved back to dynamicArrayType for the new, zero-length, copy array.

#4 Updated by Greg Shah over 3 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

Also available in: Atom PDF