From 7715b70374a9e5289fd4bf5a29923bd38fb318bd Mon Sep 17 00:00:00 2001 From: Botond Baranyi <botond.baranyi@ericsson.com> Date: Tue, 26 Mar 2019 16:49:23 +0100 Subject: [PATCH] Fixed compiler crash when logging 'omit' (bug 545802) Change-Id: I6211f01c5074e7056de634d1cc788127b040ecdf Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com> --- compiler2/Value.cc | 4 ---- .../TTCN3_SA_ttcn3adhoc_TD.script | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/compiler2/Value.cc b/compiler2/Value.cc index 1ca9f2822..3dbfd1210 100644 --- a/compiler2/Value.cc +++ b/compiler2/Value.cc @@ -11422,10 +11422,6 @@ void Value::chk_expr_operand_execute_refd(Value *v1, switch (la->get_type()) { case Ttcn::LogArgument::L_UNDEF: case Ttcn::LogArgument::L_ERROR: - FATAL_ERROR("%s argument type", - u.expr.v_optype == OPTYPE_ANY2UNISTR ? "any2unistr" : "log2str"); - break; // not reached - case Ttcn::LogArgument::L_MACRO: case Ttcn::LogArgument::L_STR: break; // self reference not possible diff --git a/function_test/Semantic_Analyser/TTCN3_SA_ttcn3adhoc_TD.script b/function_test/Semantic_Analyser/TTCN3_SA_ttcn3adhoc_TD.script index 97a53cd32..1e682e272 100644 --- a/function_test/Semantic_Analyser/TTCN3_SA_ttcn3adhoc_TD.script +++ b/function_test/Semantic_Analyser/TTCN3_SA_ttcn3adhoc_TD.script @@ -8651,4 +8651,28 @@ is not a reference to a type <END_TC> :exmp. +*-----------------------------------------------------------* +:h3.Adhoc:: Bug 545802: log(omit) +.*-----------------------------------------------------------* +:xmp tab=0. +<TC - Bug 545802: log(omit) + +<COMPILE> +<VERDICT_LEAF FAIL> +<MODULE TTCN Temp Temp.ttcn> +module Temp { + +control { + var charstring x := log2str(omit); + log(omit); +} + +} +<END_MODULE> +<RESULT IF_FAIL COUNT 2> +Cannot determine the type of the argument +<END_RESULT> +<END_TC> +:exmp. + :etext. -- GitLab