diff --git a/compiler2/Value.cc b/compiler2/Value.cc index f4d08677faeaf77ca0e236d9c429e06dd59aecbd..706f380f6cd9b6812fd0961ce053bd7777eff41b 100644 --- a/compiler2/Value.cc +++ b/compiler2/Value.cc @@ -8822,9 +8822,12 @@ void Value::chk_expr_operand_execute_refd(Value *v1, error("Cannot create an instance of abstract class type `%s'", class_->get_my_def()->get_Type()->get_typename().c_str()); } - Ttcn::FormalParList* fp_list = class_->get_constructor()->get_FormalParList(); + Common::Assignment* constructor = class_->get_constructor(); + Ttcn::FormalParList* fp_list = (constructor != NULL) ? + constructor->get_FormalParList() : NULL; Ttcn::ActualParList* parlist = new Ttcn::ActualParList; - bool is_erroneous = fp_list->chk_actual_parlist(u.expr.t_list2->get_tis(), parlist); + bool is_erroneous = (constructor != NULL) ? + fp_list->chk_actual_parlist(u.expr.t_list2->get_tis(), parlist) : true; if (is_erroneous) { delete parlist; parlist = 0; diff --git a/compiler2/ttcn3/AST_ttcn3.cc b/compiler2/ttcn3/AST_ttcn3.cc index ff46e56eec21a13706c0990958a2efeb443ce3d5..d41b73d93f0469d1800f51415bd12f7e5bf0c5b8 100644 --- a/compiler2/ttcn3/AST_ttcn3.cc +++ b/compiler2/ttcn3/AST_ttcn3.cc @@ -883,6 +883,9 @@ namespace Ttcn { // if the referred assignment is a class type, then the reference and // its parameters are meant for the constructor instead ass = type->get_class_type_body()->get_constructor(); + if (ass == NULL) { + return NULL; + } } } FormalParList* fplist = ass->get_FormalParList();