Skip to content

Commit f613c83

Browse files
committed
Fix regression in fix_fortran_dims
1 parent b28f3a4 commit f613c83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/Modules/fortran.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int fix_fortran_dims(Node *n, const char *tmap_name, String *typemap) {
120120
int ndim = SwigType_array_ndim(t);
121121
for (int i = 0; i < ndim; i++) {
122122
String *dim = SwigType_array_getdim(t, i);
123-
if (dim && !is_fortran_intexpr(dim)) {
123+
if (dim && Len(dim) > 0 && !is_fortran_intexpr(dim)) {
124124
Swig_warning(WARN_LANG_IDENTIFIER, input_file, line_number,
125125
"Array dimension expression '%s' is incompatible with Fortran\n",
126126
dim);
@@ -2864,7 +2864,6 @@ int FORTRAN::constantWrapper(Node *n) {
28642864
// Save some properties that get temporarily changed
28652865
Swig_save("constantWrapper", n, "wrap:name", "lname", "fortran:name", NULL);
28662866

2867-
String *nodetype = nodeType(n);
28682867
String *value = NULL;
28692868

28702869
if (String *override_value = Getattr(n, "feature:fortran:constvalue")) {
@@ -2874,6 +2873,7 @@ int FORTRAN::constantWrapper(Node *n) {
28742873
value = Getattr(n, "rawval");
28752874
}
28762875

2876+
String *nodetype = nodeType(n);
28772877
if (Strcmp(nodetype, "enumitem") == 0) {
28782878
// Set type from the parent enumeration
28792879
// XXX why??

0 commit comments

Comments
 (0)