ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0006702 | Part 01: TTCN-3 Core Language | Technical | public | 11-03-2014 12:19 | 06-01-2015 17:07

Reporter | Tomas Urban |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | N/A
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | v4.5.1 (published 2013-04) |
Target Version | v4.7.1 (published 2015-06) | Fixed in Version | v4.7.1 (published 2015-06) |
Clause Reference(s) | 19.1
Source (company - Author) | Elvior

Summary | 0006702: Assignment of partially initialized values of structured types

Description

During porting code from a different TTCN-3 tool to our tool, we encountered an interesting problem. The problem is related to the following code:
type record MyRecord
{
charstring field1,
charstring field2,
charstring field3
}
...
var MyRecord v_MyList1;
var MyRecord v_MyList2;
v_MyList1 := {value1”, “value2”, “value3” };
v_MyList2.field2 := “newvalue”; // leaving field1 and field3 uninitialized
v_MyList1 := v_MyList2;
In our tool, the value of v_MyList1 after the last assignment is {<uninitialized>, “newvalue”, <uninitialized>}, while in the other tool it is {“value1”, “newvalue”, “value3” }.
Our position is that only general assignment rules apply to the last assignment, thus the whole record value is assigned to the v_MyList1 variable completely ovewriting its previous content.
The specification does contain rules that allow the original values to be kept after an assignment, but these rules are related to specific value notations occuring on the RHS: assignment notation and list notation (specified in 6.2).
In order to prevent this kind of different interpretations, we would welcome if the next edition of the TTCN-3 standard contained either a note or an explicit rule mentioning that the whole value is assigned in this case including uninitialized fields (i.e. all fields of the original value get overwritten).

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR6702_v1-140616-JG.docx (19,702) 18-06-2014 10:43 http://oldforge.etsi.org/mantis/file_download.php?file_id=3045&type=bug CR6702_v2-140618-TU.docx (24,597) 18-06-2014 14:10 http://oldforge.etsi.org/mantis/file_download.php?file_id=3054&type=bug

Issue History
Date Modified | Username | Field | Change
11-03-2014 12:19 | Tomas Urban | New Issue |
07-04-2014 14:00 | Jens Grabowski | Note Added: 0011938 |
07-04-2014 14:00 | Jens Grabowski | Assigned To | => Jens Grabowski
07-04-2014 14:00 | Jens Grabowski | Status | new => assigned
08-04-2014 17:04 | Gyorgy Rethy | Target Version | => v4.7.1 (published 2015-06)
17-06-2014 13:43 | Gyorgy Rethy | Note Added: 0012105 |
18-06-2014 10:43 | Jens Grabowski | File Added: CR6702_v1-140616-JG.docx |
18-06-2014 10:44 | Jens Grabowski | Note Added: 0012120 |
18-06-2014 10:44 | Jens Grabowski | Assigned To | Jens Grabowski => Tomas Urban
18-06-2014 10:44 | Jens Grabowski | Status | assigned => confirmed
18-06-2014 14:10 | Tomas Urban | File Added: CR6702_v2-140618-TU.docx |
18-06-2014 14:12 | Tomas Urban | Note Added: 0012127 |
18-06-2014 14:12 | Tomas Urban | Status | confirmed => resolved
18-06-2014 14:12 | Tomas Urban | Resolution | open => fixed
18-06-2014 14:12 | Tomas Urban | Assigned To | Tomas Urban => Gyorgy Rethy
06-01-2015 17:07 | Gyorgy Rethy | Note Added: 0012645 |
06-01-2015 17:07 | Gyorgy Rethy | Status | resolved => closed
06-01-2015 17:07 | Gyorgy Rethy | Fixed in Version | => v4.7.1 (published 2015-06)

Notes

(0011938)
Jens Grabowski
07-04-2014 14:00

Assignment of an uninitialized value results in an uninitialized value. Add example.

(0012105)
Gyorgy Rethy
17-06-2014 13:43

STF discussion: A structured value on the RHS shall be assigned completely to LHS, I.e., if a partially initialized var is assigned to a completely initialized one, fields uninitialized at the RHS shall also become uninitialized at the LHS.

(0012120)
Jens Grabowski
18-06-2014 10:44

Resolution proposal attached, assigned to Tomas for proofreading.

(0012127)
Tomas Urban
18-06-2014 14:12

I made one cosmetic change in the example, replacing typographical quotation marks with correct symbol in the examples. Otherwise the proposal solves the described issue and it is ready to be included in the next version of the TTCN-3 standard.

(0012645)
Gyorgy Rethy
06-01-2015 17:07

Added to draft V4.6.3