Commit 3e004dcb authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Fixed segmentation fault when trying to access the constructor of an erroneous...


Fixed segmentation fault when trying to access the constructor of an erroneous class type (Bug 568899)
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
Change-Id: I8157e9098cf6e558e8a9a4a5bb1461f4931eb376
parent b1a7e6d3
......@@ -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;
......
......@@ -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();
......
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