Discussion:
[Pyublas] fix default constructor
Neal Becker
2010-09-24 13:22:01 UTC
Permalink
It seems without this an invalid vector is constructed, so that e.g.
pyublas::numpy_vector<int> u;
boost::size(u);

causes segfault.


diff --git a/src/cpp/pyublas/numpy.hpp b/src/cpp/pyublas/numpy.hpp
index 8c7bb82..391b078 100644
--- a/src/cpp/pyublas/numpy.hpp
+++ b/src/cpp/pyublas/numpy.hpp
@@ -730,6 +730,7 @@ namespace pyublas

public:
numpy_vector ()
+ : super(0)
{ }

// observe that PyObject handles are implicitly convertible
Andreas Kloeckner
2010-09-29 14:34:41 UTC
Permalink
Post by Neal Becker
It seems without this an invalid vector is constructed, so that e.g.
pyublas::numpy_vector<int> u;
boost::size(u);
causes segfault.
Applied, thanks. In the future, can you please send patches as
attachments rather than inline?

Thanks,
Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.tiker.net/pipermail/pyublas/attachments/20100929/06e49fe8/attachment.pgp>
Loading...