Skip to content
Snippets Groups Projects
Commit 502a04f0 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix crash in treat_Struct_FullName_Float

parent 845ab7dd
No related branches found
No related tags found
No related merge requests found
...@@ -14155,13 +14155,14 @@ double treat_Struct_FullName_Float ...@@ -14155,13 +14155,14 @@ double treat_Struct_FullName_Float
} }
else if (type_var == 2) { else if (type_var == 2) {
gmsh_yysymbol &s(gmsh_yysymbols[c2]); gmsh_yysymbol &s(gmsh_yysymbols[c2]);
if((int)s.value.size() < index + 1){ if(index < 0 || (int)s.value.size() < index + 1){
out = val_default; out = val_default;
if (type_treat == 0) yymsg(0, "Uninitialized variable '%s[%d]'", c2, index); if (type_treat == 0) yymsg(0, "Uninitialized variable '%s[%d]'", c2, index);
} }
else else{
out = s.value[index]; out = s.value[index];
} }
}
else { else {
out = val_default; out = val_default;
} }
......
...@@ -6702,13 +6702,14 @@ double treat_Struct_FullName_Float ...@@ -6702,13 +6702,14 @@ double treat_Struct_FullName_Float
} }
else if (type_var == 2) { else if (type_var == 2) {
gmsh_yysymbol &s(gmsh_yysymbols[c2]); gmsh_yysymbol &s(gmsh_yysymbols[c2]);
if((int)s.value.size() < index + 1){ if(index < 0 || (int)s.value.size() < index + 1){
out = val_default; out = val_default;
if (type_treat == 0) yymsg(0, "Uninitialized variable '%s[%d]'", c2, index); if (type_treat == 0) yymsg(0, "Uninitialized variable '%s[%d]'", c2, index);
} }
else else{
out = s.value[index]; out = s.value[index];
} }
}
else { else {
out = val_default; out = val_default;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment