I built crypto++ 8.4 in visual studio 2010 and made some test code. It works fine in 'Win32|Debug', but in 'Win32|Release' hash.CalculateDigest throws an exception.
string source = "I am a programmer.";
CryptoPP::SHA512 hash;
CryptoPP::byte digest[CryptoPP::SHA512::DIGESTSIZE];
hash.CalculateDigest(digest, (const CryptoPP::byte*)source.c_str(), source.length());
string result;
CryptoPP::HexEncoder encoder;
encoder.Attach(new CryptoPP::StringSink(result));
encoder.Put(digest, sizeof(digest));
The location where the exception occurs is as follows. (sha.cpp)

What have I done wrong?