changeset 33623:4517f929c59d bytecode-interpreter

maint: Merge default to bytecode-interpreter
author Arun Giridhar <arungiridhar@gmail.com>
date Fri, 24 May 2024 16:22:41 -0400
parents ec2635a02328 (current diff) b90a67c7519b (diff)
children ba926ca42470
files .github/workflows/make.yaml configure.ac
diffstat 3 files changed, 39 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/.github/workflows/make.yaml	Tue May 21 18:29:03 2024 +0200
+++ b/.github/workflows/make.yaml	Fri May 24 16:22:41 2024 -0400
@@ -282,6 +282,9 @@
             readline-dev
             suitesparse-dev
             texinfo
+            texmf-dist-lang
+            texmf-dist-latexrecommended
+            texmf-dist-plaingeneric
             xvfb-run
             xz-dev
             zlib-dev
--- a/configure.ac	Tue May 21 18:29:03 2024 +0200
+++ b/configure.ac	Fri May 24 16:22:41 2024 -0400
@@ -1000,6 +1000,17 @@
   ;;
 esac
 
+## Check if C and Fortran compilers support -fexceptions to support unwinding
+## the stack for C++ exceptions through frames in C or Fortran code.
+
+# CFLAGS are used only in the configure script.
+# XTRA_CFLAGS are used only after the configure script.
+OCTAVE_CC_FLAG([-fexceptions], [
+  CFLAGS="$CFLAGS -fexceptions"
+  XTRA_CFLAGS="$XTRA_CFLAGS -fexceptions"
+  AC_MSG_NOTICE([adding -fexceptions to XTRA_CFLAGS])])
+OCTAVE_F77_FLAG([-fexceptions])
+
 AC_SUBST(XTRA_CFLAGS)
 AC_SUBST(XTRA_CXXFLAGS)
 AC_SUBST(XTRA_LDFLAGS)
--- a/libinterp/parse-tree/pt-idx.cc	Tue May 21 18:29:03 2024 +0200
+++ b/libinterp/parse-tree/pt-idx.cc	Fri May 24 16:22:41 2024 -0400
@@ -153,13 +153,35 @@
 
     case '.':
       {
-        tree_expression *dyn_field = m_dyn_field.back ();
-        return dyn_field->end_pos ();
+        string_vector arg_names = m_arg_nm.back ();
+
+        if (arg_names.empty ())
+          {
+            tree_expression *dyn_field = m_dyn_field.back ();
+
+            if (dyn_field)
+              return dyn_field->end_pos ();
+            else
+              error ("unexpected: dynamic field is nullptr in call to tree_index_expression::end_pos - please report this bug");
+
+          }
+
+        token dot_tok = m_dot_tok.back ();
+        std::string arg_nm = arg_names(0);
+
+        // FIXME: this might not be correct because we have no way
+        // to account for space between the '.' operator and the
+        // field name.  Maybe we should really be storing an
+        // identifier that contains position information?
+
+        filepos pos = dot_tok.end_pos ();
+        pos.increment_column (arg_nm.size ());
+
+        return pos;
       }
 
     default:
       error ("unexpected: index not '(', '{', or '.' in tree_index_expression::end_pos - please report this bug");
-      break;
     }
 }