From 195d836512762a724602a35387713426bf417b6a Mon Sep 17 00:00:00 2001
From: Botond Baranyi <botond.baranyi@ericsson.com>
Date: Mon, 10 Aug 2020 16:23:05 +0200
Subject: [PATCH] Changed previous fix to only affect 'activate', and not all
 references (bug 565952)

Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com>
Change-Id: I29ac69ec3a7f024ff96ce56c398fe68533a803f5
---
 compiler2/ttcn3/AST_ttcn3.cc | 5 ++---
 compiler2/ttcn3/AST_ttcn3.hh | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/compiler2/ttcn3/AST_ttcn3.cc b/compiler2/ttcn3/AST_ttcn3.cc
index 9f313c473..f3f13e321 100644
--- a/compiler2/ttcn3/AST_ttcn3.cc
+++ b/compiler2/ttcn3/AST_ttcn3.cc
@@ -735,9 +735,8 @@ namespace Ttcn {
     Free(expr_cache);
   }
   
-  bool Reference::has_parameters()
+  bool Reference::has_parameters() const
   {
-    get_refd_assignment(); // make sure the reference is checked
     return params_checked ? parlist != NULL : params != NULL;
   }
 
@@ -1005,11 +1004,11 @@ namespace Ttcn {
 
   bool Reference::chk_activate_argument()
   {
+    Common::Assignment *t_ass = get_refd_assignment();
     if (!has_parameters()) {
       error("Reference with actual parameter list was expected in the argument");
       return false;
     }
-    Common::Assignment *t_ass = get_refd_assignment();
     if (!t_ass) return false;
     if (t_ass->get_asstype() != Common::Assignment::A_ALTSTEP) {
       error("Reference to an altstep was expected in the argument instead of "
diff --git a/compiler2/ttcn3/AST_ttcn3.hh b/compiler2/ttcn3/AST_ttcn3.hh
index c672555a1..2d7039ac1 100644
--- a/compiler2/ttcn3/AST_ttcn3.hh
+++ b/compiler2/ttcn3/AST_ttcn3.hh
@@ -364,7 +364,7 @@ namespace Ttcn {
     Reference(Identifier *p_modid, Identifier *p_id,
               ParsedActualParameters *p_params, reftype_t p_reftype = REF_BASIC);
     ~Reference();
-    virtual bool has_parameters();
+    virtual bool has_parameters() const;
     virtual Reference *clone() const;
     virtual void set_fullname(const string& p_fullname);
     virtual void set_my_scope(Scope* p_scope);
-- 
GitLab