Project

General

Profile

Bug #7308

4GL does not validate the extent index in a 'DEF VAR ... LIKE v1[100]' case, where v1 is extent or scalar.

Added by Constantin Asofiei about 1 year ago. Updated 12 months ago.

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

100%

billable:
No
vendor_id:
GCD
case_num:
version:

History

#2 Updated by Constantin Asofiei about 1 year ago

This test works fine in 4GL:

def var l1 as int extent .
def var l2 like l1[100].
def var l3 like l2[100].

def var v1 as int extent 2.
def var v2 like v1[100].
def var v3 like v2[100].

message l2 l3 v2 v3.  // ? ? 0 0

The difference is that for indeterminate extent, the initial value is unknown, while for the other case, is 0.

#3 Updated by Constantin Asofiei about 1 year ago

For function parameters, the LBRACKET is completely ignored. For procedure parameters, it works as a DEF VAR:

def var j as int extent.

function func1 returns int (input i like l1[100]).
message extent(i). // extent ?
end.

function func2 returns int (output i like v1[100]).
   message extent(i).  // extent 2
end.

func1(j).
func2(j).

procedure proc1.
   def input param p1 like l1[100].
   message extent(p1).  // scalar
end.

procedure proc2.
   def output param p2 like v1[100].
   message extent(p2). // scalar
end.

def var i as int.
run proc1(i).
run proc2(output i).

#4 Updated by Constantin Asofiei about 1 year ago

  • Assignee set to Constantin Asofiei
  • % Done changed from 0 to 100
  • Status changed from New to Review

The fix is in 7199c rev 14557

#5 Updated by Greg Shah about 1 year ago

  • Status changed from Review to Test

Code Review Task Branch 7199c Revision 14557

No objections.

#6 Updated by Constantin Asofiei 12 months ago

7199c was merged to trunk rev 14610 and archived

#7 Updated by Greg Shah 12 months ago

  • Status changed from Test to Closed

Also available in: Atom PDF