X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FSpookyHashV2.cpp;h=e2f665f2259dd6d830361a0e4511b6928bbdaa57;hb=82ba5835fb134d84cf15f23d2a1eb3ba93858385;hp=e6113a39848e5aeb71506d914a953c190fdda3ab;hpb=9f4a587cd1494371359adaf7f296c0d3a8ee3a2b;p=folly.git diff --git a/folly/SpookyHashV2.cpp b/folly/SpookyHashV2.cpp index e6113a39..e2f665f2 100644 --- a/folly/SpookyHashV2.cpp +++ b/folly/SpookyHashV2.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2014 Facebook, Inc. + * Copyright 2015 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -323,7 +323,7 @@ void SpookyHashV2::Update(const void *message, size_t length) // report the hash for the concatenation of all message fragments so far -void SpookyHashV2::Final(uint64_t *hash1, uint64_t *hash2) +void SpookyHashV2::Final(uint64_t *hash1, uint64_t *hash2) const { // init the variables if (m_length < sc_bufSize) @@ -334,7 +334,9 @@ void SpookyHashV2::Final(uint64_t *hash1, uint64_t *hash2) return; } - const uint64_t *data = (const uint64_t *)m_data; + uint64_t buf[2*sc_numVars]; + memcpy(buf, m_data, sizeof(buf)); + uint64_t *data = buf; uint8_t remainder = m_remainder; uint64_t h0 = m_state[0];