Commit b36cb668 authored by Kristof Szabados's avatar Kristof Szabados
Browse files

add protection against null pointer exception in the form of an error message...


add protection against null pointer exception in the form of an error message that the user can use to find the reason for the problem.
Signed-off-by: Kristof Szabados's avatarkristof <Kristof.Szabados@ericsson.com>
parent d405730a
......@@ -597,6 +597,7 @@ Module_Param* CHARACTER_STRING_identification_template::get_param(Module_Param_N
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported value of type CHARACTER STRING.identification.");
break;
}
if (is_ifpresent) {
......@@ -1933,6 +1934,7 @@ Module_Param* CHARACTER_STRING_identification_syntaxes_template::get_param(Modul
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type CHARACTER STRING.identification.syntaxes.");
break;
}
if (is_ifpresent) {
......@@ -2666,6 +2668,7 @@ Module_Param* CHARACTER_STRING_identification_context__negotiation_template::get
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type CHARACTER STRING.identification.context-negotiation.");
break;
}
if (is_ifpresent) {
......@@ -3546,6 +3549,7 @@ Module_Param* CHARACTER_STRING_template::get_param(Module_Param_Name& param_name
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type CHARACTER STRING.");
break;
}
if (is_ifpresent) {
......
......@@ -584,6 +584,7 @@ Module_Param* EMBEDDED_PDV_identification_template::get_param(Module_Param_Name&
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported value of type EMBEDDED PDV.identification.");
break;
}
if (is_ifpresent) {
......@@ -1937,6 +1938,7 @@ Module_Param* EMBEDDED_PDV_identification_syntaxes_template::get_param(Module_Pa
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type EMBEDDED PDV.identification.syntaxes.");
break;
}
if (is_ifpresent) {
......@@ -2678,6 +2680,7 @@ Module_Param* EMBEDDED_PDV_identification_context__negotiation_template::get_par
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type EMBEDDED PDV.identification.context-negotiation.");
break;
}
if (is_ifpresent) {
......@@ -3563,6 +3566,7 @@ Module_Param* EMBEDDED_PDV_template::get_param(Module_Param_Name& param_name) co
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type EMBEDDED PDV.");
break;
}
if (is_ifpresent) {
......
......@@ -1214,6 +1214,7 @@ Module_Param* EXTERNAL_identification_template::get_param(Module_Param_Name& par
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported value of type EXTERNAL.identification.");
break;
}
if (is_ifpresent) {
......@@ -2239,6 +2240,7 @@ Module_Param* EXTERNAL_identification_syntaxes_template::get_param(Module_Param_
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type EXTERNAL.identification.syntaxtes .");
break;
}
if (is_ifpresent) {
......@@ -2885,6 +2887,7 @@ Module_Param* EXTERNAL_identification_context__negotiation_template::get_param(M
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type EXTERNAL.identification.context-negotiation.");
break;
}
if (is_ifpresent) {
......@@ -3652,6 +3655,7 @@ Module_Param* EXTERNAL_template::get_param(Module_Param_Name& param_name) const
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type EXTERNAL.");
break;
}
if (is_ifpresent) {
......
......@@ -624,6 +624,7 @@ Module_Param* ASN_NULL_template::get_param(Module_Param_Name& param_name) const
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported ASN.1 NULL template.");
break;
}
if (is_ifpresent) {
......
......@@ -2023,9 +2023,10 @@ Module_Param* BITSTRING_template::get_param(Module_Param_Name& param_name) const
mp = new Module_Param_Bitstring_Template(pattern_value->n_elements, val_cpy);
break; }
case DECODE_MATCH:
mp->error("Referencing a decoded content matching template is not supported.");
TTCN_error("Referencing a decoded content matching template is not supported.");
break;
default:
TTCN_error("Referencing an uninitialized/unsupported bitstring template.");
break;
}
if (is_ifpresent) {
......
......@@ -1114,6 +1114,7 @@ Module_Param* BOOLEAN_template::get_param(Module_Param_Name& param_name) const
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported boolean template.");
break;
}
if (is_ifpresent) {
......
......@@ -2838,9 +2838,10 @@ Module_Param* CHARSTRING_template::get_param(Module_Param_Name& param_name) cons
mp = new Module_Param_Pattern(mcopystr(single_value), pattern_value.nocase);
break;
case DECODE_MATCH:
mp->error("Referencing a decoded content matching template is not supported.");
TTCN_error("Referencing a decoded content matching template is not supported.");
break;
default:
TTCN_error("Referencing an uninitialized/unsupported charstring template.");
break;
}
if (is_ifpresent) {
......
......@@ -746,6 +746,7 @@ Module_Param* COMPONENT_template::get_param(Module_Param_Name& param_name) const
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported component reference template.");
break;
}
if (is_ifpresent) {
......
......@@ -1647,6 +1647,7 @@ Module_Param* FLOAT_template::get_param(Module_Param_Name& param_name) const
value_range.max_value, value_range.max_is_present, value_range.min_is_exclusive, value_range.max_is_exclusive);
break;
default:
TTCN_error("Referencing an uninitialized/unsupported float template.");
break;
}
if (is_ifpresent) {
......
......@@ -1917,9 +1917,10 @@ Module_Param* HEXSTRING_template::get_param(Module_Param_Name& param_name) const
mp = new Module_Param_Hexstring_Template(pattern_value->n_elements, val_cpy);
break; }
case DECODE_MATCH:
mp->error("Referencing a decoded content matching template is not supported.");
TTCN_error("Referencing a decoded content matching template is not supported.");
break;
default:
TTCN_error("Referencing an uninitialized/unsupported hexstring template.");
break;
}
if (is_ifpresent) {
......
......@@ -2549,6 +2549,7 @@ Module_Param* INTEGER_template::get_param(Module_Param_Name& param_name) const
mp = new Module_Param_IntRange(lower_bound, upper_bound, value_range.min_is_exclusive, value_range.max_is_exclusive);
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported integer template.");
break;
}
if (is_ifpresent) {
......
......@@ -982,6 +982,7 @@ Module_Param* OBJID_template::get_param(Module_Param_Name& param_name) const
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported objid template.");
break;
}
if (is_ifpresent) {
......
......@@ -2154,9 +2154,10 @@ Module_Param* OCTETSTRING_template::get_param(Module_Param_Name& param_name) con
mp = new Module_Param_Octetstring_Template(pattern_value->n_elements, val_cpy);
break; }
case DECODE_MATCH:
mp->error("Referencing a decoded content matching template is not supported.");
TTCN_error("Referencing a decoded content matching template is not supported.");
break;
default:
TTCN_error("Referencing an uninitialized/unsupported octetstring template.");
break;
}
if (is_ifpresent) {
......
......@@ -1404,6 +1404,7 @@ Module_Param* Record_Of_Template::get_param(Module_Param_Name& param_name) const
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type %s.", get_descriptor()->name);
break;
}
if (is_ifpresent) {
......@@ -2290,6 +2291,7 @@ Module_Param* Set_Of_Template::get_param(Module_Param_Name& param_name) const
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type %s.", get_descriptor()->name);
break;
}
if (is_ifpresent) {
......@@ -2976,6 +2978,7 @@ Module_Param* Record_Template::get_param(Module_Param_Name& param_name) const
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type %s.", get_descriptor()->name);
break;
}
if (is_ifpresent) {
......@@ -3365,6 +3368,7 @@ Module_Param* Empty_Record_Template::get_param(Module_Param_Name& param_name) co
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported template of type %s.", get_descriptor()->name);
break;
}
if (is_ifpresent) {
......
......@@ -4580,9 +4580,10 @@ Module_Param* UNIVERSAL_CHARSTRING_template::get_param(Module_Param_Name& param_
mp = new Module_Param_Pattern(mcopystr(*pattern_string), pattern_value.nocase);
break;
case DECODE_MATCH:
mp->error("Referencing a decoded content matching template is not supported.");
TTCN_error("Referencing a decoded content matching template is not supported.");
break;
default:
TTCN_error("Referencing an uninitialized/unsupported universal charstring template.");
break;
}
if (is_ifpresent) {
......
......@@ -759,6 +759,7 @@ Module_Param* VERDICTTYPE_template::get_param(Module_Param_Name& param_name) con
}
break; }
default:
TTCN_error("Referencing an uninitialized/unsupported verdict template.");
break;
}
if (is_ifpresent) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment