1
0
forked from Mirror/wren

Addressing odd Microsoft Visual Studio 2013 optimizer bug.

This commit is contained in:
Marco Lizza
2015-01-21 11:01:09 +01:00
parent 222c2d5bbb
commit 61674112c9

View File

@ -1100,6 +1100,12 @@ int wrenDefineGlobal(WrenVM* vm, const char* name, size_t length, Value value)
return symbol;
}
// TODO: The Microsoft 2013 compiler seems to oddly inline these two
// functions, resulting in a memory access violation. For now, we are
// disabling the optimizer itself. Need further investigation.
#ifdef _MSC_VER
#pragma optimize("", off)
#endif
void wrenPinObj(WrenVM* vm, Obj* obj, WrenPinnedObj* pinned)
{
pinned->obj = obj;
@ -1111,6 +1117,9 @@ void wrenUnpinObj(WrenVM* vm)
{
vm->pinned = vm->pinned->previous;
}
#ifdef _MSC_VER
#pragma optimize("", on)
#endif
static void defineMethod(WrenVM* vm, const char* className,
const char* methodName, int numParams,