Bug 565542 - FATAL ERROR is thrown by uninitialized array index
Summary: FATAL ERROR is thrown by uninitialized array index
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: titan.core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-25 14:14 EDT by Elemer Lelik CLA
Modified: 2021-04-23 10:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elemer Lelik CLA 2020-07-25 14:14:51 EDT
module FatalError
{

modulepar
{ 
  integer     tsp_cl_num := 10;  
}


type component MTC_CT       {}; 


 testcase tc_Fatal_Error() runs on MTC_CT 
  {
    //This is OK 
    const integer     cl_num0 := 10;
    var   integer     Int0[cl_num0];
    //This terminates in a scary FATAL ERROR:
    const integer   cl_num := tsp_cl_num;
    var integer     Int[cl_num];
    //FATAL ERROR: /home/user/titan.core/Install/bin/compiler: In line 245 of ArrayDimensions.cc: ArrayDimension::get_value_type()
    //a more graceful exit, similar to the one below would be desirable:
    //This throws a controlled  error:
    //var integer     Int[tsp_cl_num];
    //FatalError.ttcn:18.25-34: error: Reference to an (evaluable) constant value was expected instead of module parameter `@FatalError.tsp_cl_num'
    
  }  

}
Comment 1 Denis Roy CLA 2021-04-23 10:42:51 EDT
This bug was migrated to GitLab: https://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues