fixed Segfault in decmatch confomance test cases (artf764443)
[deliverable/titan.core.git] / compiler2 / Value.cc
index 3fb3b9838b5c96d734a0a4ae725ce20e58f5e4b4..56a05debd9441488a562d67e3a32a0b7a0936572 100644 (file)
@@ -211,6 +211,9 @@ namespace Common {
       case OPTYPE_REMOVE_BOM:
         u.expr.v1=p.u.expr.v1->clone();
         break;
+      case OPTYPE_HOSTID: // [v1]
+        u.expr.v1=p.u.expr.v1?p.u.expr.v1->clone():0;
+        break;
       case OPTYPE_ADD: // v1 v2
       case OPTYPE_SUBTRACT:
       case OPTYPE_MULTIPLY:
@@ -298,6 +301,11 @@ namespace Common {
         u.expr.r1=p.u.expr.r1->clone();
         u.expr.v2=p.u.expr.v2?p.u.expr.v2->clone():0;
         break;
+      case OPTYPE_CHECKSTATE_ANY: // [r1] v2
+      case OPTYPE_CHECKSTATE_ALL:
+        u.expr.r1=p.u.expr.r1?p.u.expr.r1->clone():0;
+        u.expr.v2=p.u.expr.v2->clone();
+        break;
       case OPTYPE_COMP_CREATE: // r1 [v2] [v3]
         u.expr.r1=p.u.expr.r1->clone();
         u.expr.v2=p.u.expr.v2?p.u.expr.v2->clone():0;
@@ -340,6 +348,7 @@ namespace Common {
         u.expr.v3 = p.u.expr.v3 ? p.u.expr.v3->clone() : 0;
         break;
       case OPTYPE_LOG2STR:
+      case OPTYPE_ANY2UNISTR:
         u.expr.logargs = p.u.expr.logargs->clone();
         break;
       default:
@@ -522,6 +531,7 @@ namespace Common {
     case OPTYPE_REMOVE_BOM:
     case OPTYPE_GET_STRINGENCODING:
     case OPTYPE_DECODE_BASE64:
+    case OPTYPE_HOSTID:
       delete u.expr.v1;
       break;
     case OPTYPE_ADD: // v1 v2
@@ -610,6 +620,11 @@ namespace Common {
       delete u.expr.r1;
       delete u.expr.v2;
       break;
+    case OPTYPE_CHECKSTATE_ANY: // [r1] v2
+    case OPTYPE_CHECKSTATE_ALL:
+      delete u.expr.r1;
+      delete u.expr.v2;
+      break;
     case OPTYPE_COMP_CREATE: // r1 [v2] [v3] b4
       delete u.expr.r1;
       delete u.expr.v2;
@@ -647,6 +662,7 @@ namespace Common {
       delete u.expr.v3;
       break;
     case OPTYPE_LOG2STR:
+    case OPTYPE_ANY2UNISTR:
       delete u.expr.logargs;
       break;
     default:
@@ -910,6 +926,9 @@ namespace Common {
       if(!p_v1) FATAL_ERROR("Value::Value()");
       u.expr.v1=p_v1;
       break;
+    case OPTYPE_HOSTID:
+      u.expr.v1=p_v1;
+      break;
     default:
       FATAL_ERROR("Value::Value()");
     } // switch
@@ -933,6 +952,8 @@ namespace Common {
     case OPTYPE_TTCN2STRING:
       if(!p_ti1) FATAL_ERROR("Value::Value()");
       u.expr.ti1=p_ti1;
+      // Needed in the case of OPTYPE_ENCVALUE_UNICHAR
+      u.expr.v2=NULL;
       break;
     default:
       FATAL_ERROR("Value::Value()");
@@ -995,7 +1016,7 @@ namespace Common {
     }
   }
 
-  // r1 [v2]
+  // r1 [v2] or [r1] v2
   Value::Value(operationtype_t p_optype, Ttcn::Ref_base *p_r1, Value *p_v2)
     : GovernedSimple(S_V), valuetype(V_EXPR), my_governor(0)
   {
@@ -1007,6 +1028,12 @@ namespace Common {
       u.expr.r1=p_r1;
       u.expr.v2=p_v2;
       break;
+    case OPTYPE_CHECKSTATE_ANY:
+    case OPTYPE_CHECKSTATE_ALL:
+      if(!p_v2) FATAL_ERROR("Value::Value()");
+      u.expr.r1=p_r1; // may be null if any port or all port
+      u.expr.v2=p_v2;
+      break;
     default:
       FATAL_ERROR("Value::Value()");
     } // switch
@@ -1215,6 +1242,7 @@ namespace Common {
     u.expr.state = EXPR_NOT_CHECKED;
     switch(p_optype) {
     case OPTYPE_LOG2STR:
+    case OPTYPE_ANY2UNISTR:
       if (!p_logargs) FATAL_ERROR("Value::Value()");
       u.expr.logargs = p_logargs;
       break;
@@ -1316,6 +1344,8 @@ namespace Common {
       if(!p_r1 || !p_r2) FATAL_ERROR("Value::Value()");
       u.expr.r1=p_r1;
       u.expr.r2=p_r2;
+      // Needed in the case of OPTYPE_DECVALUE_UNICHAR
+      u.expr.v3=NULL;
       break;
     default:
       FATAL_ERROR("Value::Value()");
@@ -1515,6 +1545,9 @@ namespace Common {
     case OPTYPE_DECODE_BASE64:
       u.expr.v1->set_fullname(p_fullname+".<operand>");
       break;
+    case OPTYPE_HOSTID: // [v1]
+      if(u.expr.v1) u.expr.v1->set_fullname(p_fullname+".<operand>");
+      break;
     case OPTYPE_ADD: // v1 v2
     case OPTYPE_SUBTRACT:
     case OPTYPE_MULTIPLY:
@@ -1640,6 +1673,13 @@ namespace Common {
     case OPTYPE_LOG2STR:
       u.expr.logargs->set_fullname(p_fullname+".<logargs>");
       break;
+    case OPTYPE_ANY2UNISTR:
+      u.expr.logargs->set_fullname(p_fullname+".<logarg>");
+      break;
+    case OPTYPE_CHECKSTATE_ANY: // [r1] v2
+    case OPTYPE_CHECKSTATE_ALL:
+      u.expr.v2->set_fullname(p_fullname+".<operand1>");
+      break;
     default:
       FATAL_ERROR("Value::set_fullname_expr()");
     } // switch
@@ -1703,6 +1743,9 @@ namespace Common {
     case OPTYPE_DECODE_BASE64:
       u.expr.v1->set_my_scope(p_scope);
       break;
+    case OPTYPE_HOSTID: // [v1]
+      if(u.expr.v1) u.expr.v1->set_my_scope(p_scope);
+      break;
     case OPTYPE_ADD: // v1 v2
     case OPTYPE_SUBTRACT:
     case OPTYPE_MULTIPLY:
@@ -1792,6 +1835,11 @@ namespace Common {
       u.expr.r1->set_my_scope(p_scope);
       if(u.expr.v2) u.expr.v2->set_my_scope(p_scope);
       break;
+    case OPTYPE_CHECKSTATE_ANY: // [r1] v2
+    case OPTYPE_CHECKSTATE_ALL:
+      if(u.expr.r1) u.expr.r1->set_my_scope(p_scope);
+      u.expr.v2->set_my_scope(p_scope);
+      break;
     case OPTYPE_COMP_CREATE: // r1 [v2] [v3]
       u.expr.r1->set_my_scope(p_scope);
       if(u.expr.v2) u.expr.v2->set_my_scope(p_scope);
@@ -1828,6 +1876,7 @@ namespace Common {
        u.expr.v3->set_my_scope(p_scope);
       break;
     case OPTYPE_LOG2STR:
+    case OPTYPE_ANY2UNISTR:
       u.expr.logargs->set_my_scope(p_scope);
       break;
     default:
@@ -2022,6 +2071,9 @@ namespace Common {
       case OPTYPE_REMOVE_BOM:
         u.expr.v1->set_code_section(p_code_section);
         break;
+      case OPTYPE_HOSTID: // [v1]
+        if(u.expr.v1) u.expr.v1->set_code_section(p_code_section);
+        break;
       case OPTYPE_ADD: // v1 v2
       case OPTYPE_SUBTRACT:
       case OPTYPE_MULTIPLY:
@@ -2111,6 +2163,11 @@ namespace Common {
         u.expr.r1->set_code_section(p_code_section);
         if(u.expr.v2) u.expr.v2->set_code_section(p_code_section);
         break;
+      case OPTYPE_CHECKSTATE_ANY: // [r1] v2
+      case OPTYPE_CHECKSTATE_ALL:
+        if(u.expr.r1) u.expr.r1->set_code_section(p_code_section);
+        u.expr.v2->set_code_section(p_code_section);
+        break;
       case OPTYPE_COMP_CREATE: // r1 [v2] [v3] b4
         u.expr.r1->set_code_section(p_code_section);
         if(u.expr.v2) u.expr.v2->set_code_section(p_code_section);
@@ -2152,6 +2209,7 @@ namespace Common {
           u.expr.v3->set_code_section(p_code_section);
       break;
       case OPTYPE_LOG2STR:
+      case OPTYPE_ANY2UNISTR:
         u.expr.logargs->set_code_section(p_code_section);
         break;
       default:
@@ -2891,6 +2949,8 @@ namespace Common {
       case OPTYPE_ISVALUE:
       case OPTYPE_ISBOUND:
       case OPTYPE_PROF_RUNNING:
+      case OPTYPE_CHECKSTATE_ANY:
+      case OPTYPE_CHECKSTATE_ALL:
         return Type::T_BOOL;
       case OPTYPE_GETVERDICT:
         return Type::T_VERDICT;
@@ -3127,10 +3187,12 @@ namespace Common {
       case OPTYPE_TTCN2STRING:
       case OPTYPE_GET_STRINGENCODING:
       case OPTYPE_ENCODE_BASE64:
+      case OPTYPE_HOSTID:
         return Type::T_CSTR;
       case OPTYPE_INT2UNICHAR:
       case OPTYPE_OCT2UNICHAR:
       case OPTYPE_ENCVALUE_UNICHAR:
+      case OPTYPE_ANY2UNISTR:
         return Type::T_USTR;
       case OPTYPE_INT2BIT:
       case OPTYPE_HEX2BIT:
@@ -3391,6 +3453,18 @@ namespace Common {
       return "getverdict()";
     case OPTYPE_TESTCASENAME:
       return "testcasename()";
+    case OPTYPE_CHECKSTATE_ANY:
+      if (u.expr.r1) {
+        return "port.checkstate()";
+      } else {
+        return "any port.checkstate()";
+      }
+    case OPTYPE_CHECKSTATE_ALL:
+      if (u.expr.r1) {
+        return "port.checkstate()";
+      } else {
+        return "all port.checkstate()";
+      }
     case OPTYPE_UNARYPLUS: // v1
       return "unary +";
     case OPTYPE_UNARYMINUS:
@@ -3477,6 +3551,8 @@ namespace Common {
       return "encode_base64()";
     case OPTYPE_DECODE_BASE64:
       return "decode_base64()";
+    case OPTYPE_HOSTID: // [v1]
+      return "hostid()";
     case OPTYPE_ADD: // v1 v2
       return "+";
     case OPTYPE_SUBTRACT:
@@ -3578,6 +3654,8 @@ namespace Common {
       return "isbound()";
     case OPTYPE_LOG2STR:
       return "log2str()";
+    case OPTYPE_ANY2UNISTR:
+      return "any2unistr()";
     case OPTYPE_TTCN2STRING:
       return "ttcn2string()";
     case OPTYPE_PROF_RUNNING:
@@ -5402,7 +5480,8 @@ void Value::chk_expr_operand_execute_refd(Value *v1,
   void Value::chk_expr_operand_encode(ReferenceChain *refch,
     Type::expected_value_t exp_val) {
 
-    Error_Context cntxt(this, "In the parameter of encvalue()");
+    Error_Context cntxt(this, "In the parameter of %s",
+      u.expr.v_optype == OPTYPE_ENCVALUE_UNICHAR ? "encvalue_unichar()" : "encvalue()");
     Type t_chk(Type::T_ERROR);
     Type* t_type;
 
@@ -5461,7 +5540,8 @@ error:
 
   void Value::chk_expr_operands_decode(operationtype_t p_optype)
   {
-    Error_Context cntxt(this, "In the parameters of decvalue()"); //todo
+    Error_Context cntxt(this, "In the parameters of %s",
+      p_optype == OPTYPE_DECVALUE_UNICHAR ? "decvalue_unichar()" : "decvalue()");
     Ttcn::Ref_base* ref = u.expr.r1;
     Ttcn::FieldOrArrayRefs* t_subrefs = ref->get_subrefs();
     Type* t_type = 0;
@@ -6535,6 +6615,17 @@ error:
         chk_expr_val_ustr_7bitchars(v1, the, opname);
       }
       break;
+    case OPTYPE_HOSTID:
+      v1=u.expr.v1 ? u.expr.v1 : 0;
+      if (v1)
+      {
+        Error_Context cntxt(this, "In the first operand of operation `%s'", opname);
+        v1->set_lowerid_to_ref();
+        tt1=v1->get_expr_returntype(exp_val);
+        chk_expr_operandtype_cstr(tt1, second, opname, v1);
+        chk_expr_eval_value(v1, t_chk, refch, exp_val);
+      }
+      break;
     case OPTYPE_UNICHAR2OCT: // v1 [v2]
       v1=u.expr.v1;
       {
@@ -7049,6 +7140,18 @@ error:
       chk_expr_operand_activate(u.expr.r1, the, opname);
       chk_expr_dynamic_part(exp_val, true);
       break;
+    case OPTYPE_CHECKSTATE_ANY: // [r1] v2
+    case OPTYPE_CHECKSTATE_ALL:
+      chk_expr_dynamic_part(exp_val, false);
+      v2=u.expr.v2;
+      if(v2) {
+        Error_Context cntxt(this, "In the first operand of operation `%s'", opname);
+        v2->set_lowerid_to_ref();
+        tt2=v2->get_expr_returntype(exp_val);
+       chk_expr_operandtype_cstr(tt2, first, opname, v2);
+       chk_expr_eval_value(v2, t_chk, refch, exp_val);
+      }
+      break;
     case OPTYPE_ACTIVATE_REFD:{ //v1 t_list2
       Ttcn::ActualParList *parlist = new Ttcn::ActualParList;
       chk_expr_operand_activate_refd(u.expr.v1,u.expr.t_list2->get_tis(), parlist, the,
@@ -7115,7 +7218,8 @@ error:
       }
       chk_expr_operands_replace();
       break; }
-    case OPTYPE_LOG2STR: {
+    case OPTYPE_LOG2STR:
+    case OPTYPE_ANY2UNISTR: {
       Error_Context cntxt(this, "In the operand of operation `%s'", opname);
       u.expr.logargs->chk();
       if (!semantic_check_only) u.expr.logargs->join_strings();
@@ -7184,6 +7288,7 @@ error:
     case OPTYPE_MATCH: // v1 t2
     case OPTYPE_ISCHOSEN_T:
     case OPTYPE_LOG2STR:
+    case OPTYPE_ANY2UNISTR:
     case OPTYPE_ENCODE:
     case OPTYPE_DECODE:
     case OPTYPE_ISBOUND:
@@ -7195,6 +7300,9 @@ error:
     case OPTYPE_DECODE_BASE64:
     case OPTYPE_ENCVALUE_UNICHAR:
     case OPTYPE_DECVALUE_UNICHAR:
+    case OPTYPE_CHECKSTATE_ANY:
+    case OPTYPE_CHECKSTATE_ALL:
+    case OPTYPE_HOSTID:
       break;
     case OPTYPE_TESTCASENAME: { // -
       if (!my_scope) FATAL_ERROR("Value::evaluate_value()");
@@ -8493,6 +8601,9 @@ error:
       case OPTYPE_DECODE_BASE64:
       case OPTYPE_ENCVALUE_UNICHAR:
       case OPTYPE_DECVALUE_UNICHAR:
+      case OPTYPE_CHECKSTATE_ANY:
+      case OPTYPE_CHECKSTATE_ALL:
+      case OPTYPE_HOSTID:
         return true;
       case OPTYPE_COMP_NULL: // -
         return false;
@@ -8627,6 +8738,7 @@ error:
       case OPTYPE_ISCHOSEN_V:
         return u.expr.v1->is_unfoldable(refch, exp_val);
       case OPTYPE_LOG2STR:
+      case OPTYPE_ANY2UNISTR:
       case OPTYPE_TTCN2STRING:
         return true;
       default:
@@ -9706,6 +9818,13 @@ error:
       u.expr.t1->chk_recursions(refch);
       refch.prev_state();
       break;
+    case OPTYPE_HOSTID: // [v1]
+      if (u.expr.v1) {
+        refch.mark_state();
+        u.expr.v1->chk_recursions(refch);
+        refch.prev_state();
+      }
+      break;
     case OPTYPE_ADD: // v1 v2
     case OPTYPE_SUBTRACT:
     case OPTYPE_MULTIPLY:
@@ -9840,6 +9959,7 @@ error:
       refch.prev_state();
       break;
     case OPTYPE_LOG2STR:
+    case OPTYPE_ANY2UNISTR:
       u.expr.logargs->chk_recursions(refch);
       break;
     default:
@@ -9969,6 +10089,9 @@ error:
       break; // self-ref can't happen
     case Ttcn::Template::TEMPLATE_INVOKE:
       break; // assume self-ref can't happen
+    case Ttcn::Template::DECODE_MATCH:
+      self_ref |= chk_expr_self_ref_templ(t->get_decode_target()->get_Template(), lhs);
+      break;
     case Ttcn::Template::TEMPLATE_ERROR:
       //FATAL_ERROR("Value::chk_expr_self_ref_templ()");
       break;
@@ -9991,7 +10114,7 @@ error:
       }
     }
     return gov->chk_this_value(v, lhs, Type::EXPECTED_DYNAMIC_VALUE,
-      INCOMPLETE_NOT_ALLOWED, OMIT_NOT_ALLOWED, NO_SUB_CHK, NOT_IMPLICIT_OMIT,
+      INCOMPLETE_NOT_ALLOWED, OMIT_ALLOWED, NO_SUB_CHK, NOT_IMPLICIT_OMIT,
       is_str_elem);
   }
 
@@ -10014,6 +10137,8 @@ error:
     case OPTYPE_TMR_RUNNING_ANY: // -
     case OPTYPE_GETVERDICT: // -
     case OPTYPE_PROF_RUNNING: // -
+    case OPTYPE_CHECKSTATE_ANY:
+    case OPTYPE_CHECKSTATE_ALL:
       break; // nothing to do
 
     case OPTYPE_MATCH: // v1 t2
@@ -10061,6 +10186,9 @@ error:
     case OPTYPE_REMOVE_BOM:
       self_ref |= chk_expr_self_ref_val(u.expr.v1, lhs);
       break;
+    case OPTYPE_HOSTID: // [v1]
+      if (u.expr.v1) self_ref |= chk_expr_self_ref_val(u.expr.v1, lhs);
+      break;
     case OPTYPE_ADD: // v1 v2
     case OPTYPE_SUBTRACT: // v1 v2
     case OPTYPE_MULTIPLY: // v1 v2
@@ -10140,14 +10268,16 @@ error:
       // boolvar := a_timer.running -- assume no self-ref
       break;
       break;
-
+      
+    case OPTYPE_ANY2UNISTR:
     case OPTYPE_LOG2STR: {// logargs
       for (size_t i = 0, e = u.expr.logargs->get_nof_logargs(); i < e; ++i) {
         const Ttcn::LogArgument *la = u.expr.logargs->get_logarg_byIndex(i);
         switch (la->get_type()) {
         case Ttcn::LogArgument::L_UNDEF:
         case Ttcn::LogArgument::L_ERROR:
-          FATAL_ERROR("log2str argument type");
+          FATAL_ERROR("%s argument type",
+            u.expr.v_optype == OPTYPE_ANY2UNISTR ? "any2unistr" : "log2str");
           break; // not reached
 
         case Ttcn::LogArgument::L_MACRO:
@@ -10439,6 +10569,10 @@ error:
          if (u.expr.v2) return create_stringRepr_predef2("encvalue_unichar");
          else return create_stringRepr_predef1("encvalue_unichar");
       }
+      case OPTYPE_HOSTID: {
+        if (u.expr.v1) return create_stringRepr_predef1("hostid");   
+        else return string("hostid()");
+      }
       case OPTYPE_DECVALUE_UNICHAR: {
          if (u.expr.v3) {
            string ret_val("decvalue_unichar");
@@ -10617,6 +10751,8 @@ error:
        return ret_val; }
       case OPTYPE_LOG2STR:
         return string("log2str(...)");
+      case OPTYPE_ANY2UNISTR:
+        return string("any2unistr(...)");     
       case OPTYPE_MATCH: {
         string ret_val("match(");
         ret_val += u.expr.v1->get_stringRepr();
@@ -10673,6 +10809,22 @@ error:
         return u.expr.r1->get_dispname() + ".running";
       case OPTYPE_TMR_RUNNING_ANY:
         return string("any timer.running");
+      case OPTYPE_CHECKSTATE_ANY:
+      case OPTYPE_CHECKSTATE_ALL: {
+        string ret_val("");
+        if (u.expr.r1) {
+          ret_val += u.expr.r1->get_dispname();
+        } else {
+          if (u.expr.v_optype == OPTYPE_CHECKSTATE_ANY) {
+            ret_val += "any port";
+          } else if (u.expr.v_optype == OPTYPE_CHECKSTATE_ALL) {
+            ret_val += "all port";
+          }
+        }
+        ret_val += "checkstate(";
+        ret_val += u.expr.v2->get_stringRepr();
+        ret_val += ")";
+        return ret_val; }
       case OPTYPE_GETVERDICT:
         return string("getverdict");
       case OPTYPE_ACTIVATE: {
@@ -11376,13 +11528,14 @@ error:
         break;
       case OPTYPE_DECODE: {
         Ttcn::ActualParList *parlist = u.expr.r1->get_parlist();
-        Common::Assignment *ass = u.expr.r1->get_refd_assignment();
         if (parlist) str = parlist->rearrange_init_code(str, usage_mod);
 
         parlist = u.expr.r2->get_parlist();
-        ass = u.expr.r2->get_refd_assignment();
         if (parlist) str = parlist->rearrange_init_code(str, usage_mod);
         break; }
+      case OPTYPE_HOSTID:    
+        if (u.expr.v1) str = u.expr.v1->rearrange_init_code(str, usage_mod);
+        break;
       case OPTYPE_ADD:
       case OPTYPE_SUBTRACT:
       case OPTYPE_MULTIPLY:
@@ -11692,6 +11845,9 @@ error:
     case OPTYPE_DECVALUE_UNICHAR:
         generate_code_expr_decvalue_unichar(expr);
       break;
+    case OPTYPE_HOSTID:
+      generate_code_expr_hostid(expr);
+      break;
     case OPTYPE_OCT2HEX:
       generate_code_expr_predef1(expr, "oct2hex", u.expr.v1);
       break;
@@ -11996,6 +12152,10 @@ error:
     case OPTYPE_ACTIVATE: // r1
       generate_code_expr_activate(expr);
       break;
+    case OPTYPE_CHECKSTATE_ANY: // [r1] v2
+    case OPTYPE_CHECKSTATE_ALL:
+      generate_code_expr_checkstate(expr);
+      break;
     case OPTYPE_ACTIVATE_REFD: // v1 ap_list2
       generate_code_expr_activate_refd(expr);
       break;
@@ -12006,6 +12166,7 @@ error:
       generate_code_expr_execute_refd(expr);
       break;
     case OPTYPE_LOG2STR:
+    case OPTYPE_ANY2UNISTR:
       u.expr.logargs->generate_code_expr(expr);
       break;
     case OPTYPE_TTCN2STRING: {
@@ -12796,6 +12957,35 @@ void Value::generate_code_expr_encvalue_unichar(expression_struct *expr)
     Code::free_expr(&expr2);
   }
   
+  void Value::generate_code_expr_checkstate(expression_struct *expr)
+  {
+    if (u.expr.r1) { 
+      // It is a port if r1 is not null
+      u.expr.r1->generate_code_const_ref(expr);
+      expr->expr = mputstr(expr->expr, ".");
+    } else {
+      // it is an any or all port if r1 is null
+      if (u.expr.v_optype == OPTYPE_CHECKSTATE_ANY) {
+       expr->expr = mputstr(expr->expr, "PORT::any_");
+      } else if (u.expr.v_optype == OPTYPE_CHECKSTATE_ALL) {
+        expr->expr = mputstr(expr->expr, "PORT::all_");
+      } else {
+        FATAL_ERROR("Value::generate_code_expr_checkstate()");
+      }
+    }
+    expr->expr = mputstr(expr->expr, "check_port_state(");
+    u.expr.v2->generate_code_expr_mandatory(expr);
+    expr->expr = mputstr(expr->expr, ")");
+  }
+  
+  void Value::generate_code_expr_hostid(expression_struct *expr)
+  {
+    expr->expr = mputstr(expr->expr, "TTCN_Runtime::get_host_address(");
+    if (u.expr.v1) u.expr.v1->generate_code_expr_mandatory(expr);
+    else expr->expr = mputstr(expr->expr, "CHARSTRING(\"Ipv4orIpv6\")");
+    expr->expr = mputstr(expr->expr, ")");
+  }
+  
   char* Value::generate_code_char_coding_check(expression_struct *expr, Value *v, const char *name)
   {
     expression_struct expr2;
@@ -13472,6 +13662,9 @@ void Value::generate_code_expr_encvalue_unichar(expression_struct *expr)
     case OPTYPE_GETVERDICT:
     case OPTYPE_TESTCASENAME:
     case OPTYPE_PROF_RUNNING:
+    case OPTYPE_CHECKSTATE_ANY:
+    case OPTYPE_CHECKSTATE_ALL:
+    case OPTYPE_HOSTID:
       return true;
     case OPTYPE_ENCODE:
     case OPTYPE_DECODE:
@@ -13580,6 +13773,7 @@ void Value::generate_code_expr_encvalue_unichar(expression_struct *expr)
     case OPTYPE_VALUEOF: // ti1
       return u.expr.ti1->has_single_expr();
     case OPTYPE_LOG2STR:
+    case OPTYPE_ANY2UNISTR:
       return u.expr.logargs->has_single_expr();
     case OPTYPE_MATCH: // v1 t2
       return u.expr.v1->has_single_expr() &&
This page took 0.031044 seconds and 5 git commands to generate.