[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #61704] Index vector related tests fail with l
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #61704] Index vector related tests fail with libc++ when compiled with visibility flags |
Date: |
Sun, 6 Nov 2022 11:23:42 -0500 (EST) |
Follow-up Comment #13, bug #61704 (project octave):
IIUC, the wrong error messages are appearing because the `index_exception`
exception isn't caught in `Fsub2ind` and `Find2sub` when linking to libc++:
https://hg.savannah.gnu.org/hgweb/octave/file/e7fc6251b698/libinterp/corefcn/sub2ind.cc
The relevant parts of the code are:
try
{
idxa(j) = args(j+1).index_vector ();
if (j > 0 && args(j+1).dims () != args(1).dims ())
error ("sub2ind: all subscripts must be of the same size");
}
catch (index_exception& ie)
{
ie.set_pos_if_unset (nargin-1, j+1);
ie.set_var ();
std::string msg = ie.message ();
error_with_id (ie.err_id (), "%s", msg.c_str ());
}
and
try
{
retval = Array<octave_value> (ind2sub (dv, args(1).index_vector ()));
if (nd == 1)
retval(0) = retval(1);
}
catch (const index_exception& ie)
{
error ("ind2sub: invalid index %s", ie.what ());
}
IIUC, the exception that is thrown in that case is of type `invalid_index`
which inherits from `index_exception`.
I would have thought that throwing an exception of that type would also be
covered by catching the parent class. And that seems to be happening when
linking to libstdc++.
Maybe a bug in LLVM libunwind?
On the other hand: Why is this only happening when we don't export all
symbols? Are we still missing some symbols that we'd need to export for this
to work correctly?
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?61704>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #61704] Index vector related tests fail with libc++ when compiled with visibility flags,
Markus Mützel <=