1
0
forked from 0ad/0ad

SpiderMonkey 38 removes JS_AllocateArrayBufferContents.

Users required the returned buffer to be passable to free(), so replace
it by malloc().
https://bugzilla.mozilla.org/show_bug.cgi?id=1037358

This was SVN commit r17511.
This commit is contained in:
leper 2015-12-19 02:49:46 +00:00
parent 190f9176df
commit 332096e4ed

View File

@ -396,8 +396,8 @@ jsval CStdDeserializer::ReadScriptVal(const char* UNUSED(name), JS::HandleObject
#if BYTE_ORDER != LITTLE_ENDIAN
#error TODO: need to convert JS ArrayBuffer data from little-endian
#endif
void* contents = NULL;
contents = JS_AllocateArrayBufferContents(cx, length);
void* contents = malloc(length);
ENSURE(contents);
RawBytes("buffer data", (u8*)contents, length);
JS::RootedObject bufferObj(cx, JS_NewArrayBufferWithContents(cx, length, contents));
AddScriptBackref(bufferObj);