Commit edd12069 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Avoid segfault when processing component types

parent 89db664e
......@@ -220,11 +220,11 @@ package body Buildsupport_Utils is
function Get_Instance_Of (Device : Node_Id) return Name_Id is
Instance_Of : Name_id := No_Name;
begin
if Is_Defined_Property (Device, "taste_iv_properties::instance_of")
if Is_Defined_Property (Device, "taste_iv_properties::is_instance_of")
then
Instance_Of := Get_String_Property
(Device, Get_String_Name
("taste_iv_properties::instance_of"));
("taste_iv_properties::is_instance_of"));
end if;
return Instance_Of;
end Get_Instance_Of;
......
......@@ -258,7 +258,16 @@ void GW_SDL_Interface(Interface * i)
void GW_SDL_Backend(FV * fv)
{
if (fv->system_ast->context->onlycv) return;
if ((sdl == fv->language || opengeode == fv->language) && (false == fv->is_component_type)) {
if ((sdl == fv->language || opengeode == fv->language)) {
printf("FV %s is in SDL\n", fv->name);
if (NULL == fv->instance_of) {
printf("Its instance_of is NULL\n");
}
else {
printf("It IS AN INSTANCE OF %s\n", fv->instance_of);
}
}
if ((sdl == fv->language || opengeode == fv->language) && (NULL == fv->instance_of)) {
Create_New_SDL_Structure(fv);
FOREACH(i, Interface, fv->interfaces, {
GW_SDL_Interface(i);
......
......@@ -327,7 +327,7 @@ void Function_Semantic_Check(FV * fv)
if (fv->is_component_type) {
if (sdl != fv->language) {
ERROR
("** Error: Is_Component_Type is True for \"%s\". This is allowed only for SDL functions.\n",
("[ERROR] Is_Component_Type is True for \"%s\". This is allowed only for SDL functions.\n",
fv->name);
add_error();
}
......@@ -337,13 +337,15 @@ void Function_Semantic_Check(FV * fv)
FV *definition = FindFV (fv->instance_of);
if (definition == NULL) {
ERROR
("** Error: Defining function \"%s\" for \"%s\" not found.\n",
("[ERROR] Component type \"%s\" (for instance \"%s\") not found.\n",
fv->instance_of, fv->name);
add_error();
return;
}
else {
if (false == definition->is_component_type) {
ERROR
("** Error: Is_Component_Type is False for \"%s\". It should be True,\n",
("[ERROR] Is_Component_Type is False for \"%s\". It should be True,\n",
definition->name);
ERROR
(" because function \"%s\" claims that it is an instance of \"%s\".\n",
......@@ -380,7 +382,7 @@ void Function_Semantic_Check(FV * fv)
definition->name, fv->name);
add_error();
}
}
}
}
......
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