Hello Andreas.
I found turning asEP_ALLOW_UNSAFE_REFERENCES to 1 would cause CContextSerializer::Serialize in file test_context.cpp to crash.
It seems that when reading scriptData->byteCode in asCScriptFunction::FindNextFunctionCalled, the array index out of the bounds, but I don't know where the real problem is.