|
Boost : |
Subject: Re: [boost] [mp_int] Patch for deallocate(NULL)
From: Nathan Kitchen (nathan.kitchen_at_[hidden])
Date: 2009-01-09 19:46:04
I neglected to include a test case that triggers the problem:
#include <iostream>
#include <boost/cstdint.hpp>
#include <boost/mp_math/mp_int.hpp>
using namespace boost::mp_math;
using namespace std;
int main()
{
mp_int<> a = 1;
cout << a << endl;
return 0;
}
On Fri, Jan 9, 2009 at 4:38 PM, Nathan Kitchen <nathan.kitchen_at_[hidden]> wrote:
> In the version of mp_math posted to the vault in Oct 2008 there are
> several calls to std::allocator::deallocate where the argument pointer
> can be NULL. This is not compliant with the C++ standard, which states
> "p must not be null" (Table 6 in 20.1.5 in the Draft Standard that I
> have access to).
>
> Sure enough, when p is null, I get a segmentation fault (using GCC 3.2.3).
>
> Attached is a patch with a fix.
>
> -- Nathan
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk