Skip to content

function makes out parameter unbound

Summary

If a variable is passed as out parameter to a function, the function renders the variable unbound even if the function does not assign a new value to the variable.

Steps and/or TTCN-3 code to reproduce

Create a module with the following content:

function fn_out_parameter_unchanged(out integer po){

}

testcase tc_out_parameter_unchanged() runs on ct_empty{ //shall pass
  var integer vo := 2;
  fn_out_parameter_unchanged(vo);
  if(not isbound(vo)){setverdict(fail);}
  //if(vo==2){setverdict(pass);}
}

Run the testcase.

What is the current bug behavior?

vo becomes unbound.

What is the expected correct behavior?

vo shall stay bound with a value of 2

Relevant logs and/or screenshots

Possible fixes

Titan version

8.1.2

Platform details (OS type and version)

Microsoft Windows 10 Enterprise 10.0.19042

/cc @aknappqwt