diff --git a/compiler2/ttcn3/AST_ttcn3.cc b/compiler2/ttcn3/AST_ttcn3.cc index 4df106929991cd4d5b8bcdc86f868ede1e6ade03..ed78fdc914f6bb4c64e85c4189ebddeac1971751 100644 --- a/compiler2/ttcn3/AST_ttcn3.cc +++ b/compiler2/ttcn3/AST_ttcn3.cc @@ -10464,8 +10464,8 @@ namespace Ttcn { } switch (defval.ap->get_selection()) { case ActualPar::AP_VALUE: { - str = update_location_object(str); Value *val = defval.ap->get_Value(); + str = val->update_location_object(str); string tmp_id; if (defpar_wrapper != Common::Type::NO_DEFPAR_WRAPPER) { tmp_id = my_scope->get_scope_mod_gen()->get_temporary_id(); @@ -10487,8 +10487,8 @@ namespace Ttcn { break; } case ActualPar::AP_TEMPLATE: { if (!use_runtime_2 || defpar_wrapper != Common::Type::NO_DEFPAR_WRAPPER) { - str = update_location_object(str); TemplateInstance *ti = defval.ap->get_TemplateInstance(); + str = ti->get_Template()->update_location_object(str); string tmp_id; if (defpar_wrapper != Common::Type::NO_DEFPAR_WRAPPER) { tmp_id = my_scope->get_scope_mod_gen()->get_temporary_id(); diff --git a/compiler2/ttcn3/Ttcnstuff.cc b/compiler2/ttcn3/Ttcnstuff.cc index 566b7f19e9618ad1fedce67c2c35a22e6be34f5a..16dd95b810fb3c63320af510dc2fc68b765db464 100644 --- a/compiler2/ttcn3/Ttcnstuff.cc +++ b/compiler2/ttcn3/Ttcnstuff.cc @@ -4199,9 +4199,11 @@ namespace Ttcn { "{\n" "if (def_) {\n", in_par ? "const " : "", par_type_str.c_str(), defpar_list.get_nth_elem(i), class_id->get_name().c_str()); - if (formal_par->get_filename() != NULL && formal_par->get_first_line() > 0) { + ActualPar* ap = formal_par->get_defval(); + Location* ap_loc = templ_par ? (Location*)ap->get_TemplateInstance()->get_Template() : (Location*)ap->get_Value(); + if (ap_loc->get_filename() != NULL && ap_loc->get_first_line() > 0) { char* loc_obj_name = mprintf("class %s default parameter", class_id->get_dispname().c_str()); - local_struct->source.methods = formal_par->create_location_object( + local_struct->source.methods = ap_loc->create_location_object( local_struct->source.methods, "UNKNOWN", loc_obj_name); Free(loc_obj_name); }