Project

General

Profile

Bug #2284

Fix parameter initialization

Added by Hynek Cihlar about 10 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
04/13/2014
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:

hc_upd20140413a.zip (22.7 KB) Hynek Cihlar, 04/13/2014 05:35 PM

hc_upd20140417a.zip (22.8 KB) Hynek Cihlar, 04/17/2014 04:05 PM


Related issues

Related to Base Language - Bug #2133: fix precision for decimal, dynamic-extent variables Closed 01/21/2014 01/27/2014

History

#1 Updated by Hynek Cihlar about 10 years ago

The following are the cases where the variable initialization fails.

  • Components of an indeterminate unfixed extent variable passed in as an input-output or output function or procedure parameter are initialized to zero values, but should be unknown.
  • Components of an extent variable passed in as an output function parameter are initialized to unknown, should be zero.
  • Integer or decimal variable passed in as an output function parameter is initialized to unknown, should be zero.
  • Character variable passed in as an output function parameter is initialized to unknown, should be an empty string.
  • Logical variable passed in as an output function parameter is initialized to unknown, should be false.

Tested on OpenEdge 10.2B.

Discovered during implementation of "fix precision for decimal, dynamic-extent variables", see #2133 notes 22, 27, 29, 31, 34, 35, 36, 42, 44.

#2 Updated by Hynek Cihlar about 10 years ago

  • Status changed from New to WIP

#3 Updated by Hynek Cihlar about 10 years ago

Attached is the fix resolving the found parameter initialization issues.

Note that the file variable_definitions.rules contained logic of Progress V9.0C. I removed that since I have no access to this version. Of course, I will test on the previous versions if needed.

#4 Updated by Constantin Asofiei about 10 years ago

Hynek Cihlar wrote:

Note that the file variable_definitions.rules contained logic of Progress V9.0C. I removed that since I have no access to this version.

Although we don't have access to V9.0C, the code in variable_definitions.rules must be kept and executed conditionally, as 4GL code written only in v9 depends on it. The 4GL version can be set via this p2j.cfg.xml configuration:

<parameter name="source-code-version" value="10.2B" />

If this is missing, then v9.0c is assumed.

In TRPL, to check the source code version, there are the isV9 and isV10 variables (for v9.0c and v10.2B cases).

#5 Updated by Hynek Cihlar about 10 years ago

The original source suggests that Progress 9.0C version behaves differently in respect to the parameter initialization. Should I then keep the original behavior for 9.0C and hope for the best that no regression was introduced?

#6 Updated by Hynek Cihlar about 10 years ago

It turns out I was running the P2J conversion without the proper version defined, i.e. with the default 9.0C as Constantin pointed out. After setting the version to 10.2B, only the following two cases really needed a fix:

  • Components of an indeterminate unfixed extent variable passed in as an input-output or output function or procedure parameter are initialized to zero values, but should be unknown.
  • Components of an extent variable passed in as an output function parameter are initialized to unknown, should be zero.

Attached is the fix for the above two initialization issues, please review. Regression test is in progress.

#7 Updated by Constantin Asofiei about 10 years ago

Hynek Cihlar wrote:

Attached is the fix for the above two initialization issues, please review. Regression test is in progress.

The changes look good.

#8 Updated by Hynek Cihlar about 10 years ago

0417a passed regression testing and was committed to bzr revision 10513.

#9 Updated by Hynek Cihlar about 10 years ago

  • % Done changed from 0 to 100
  • Status changed from WIP to Review

#10 Updated by Greg Shah about 10 years ago

  • Status changed from Review to Closed
  • Target version set to Milestone 11

#11 Updated by Greg Shah over 7 years ago

  • Target version changed from Milestone 11 to Cleanup and Stablization for Server Features

Also available in: Atom PDF