| 194 | |
| 195 | static std::stringstream printResult; |
| 196 | static void print(asIScriptGeneric* gen) |
| 197 | { |
| 198 | void* ptr = *(void**)gen->GetAddressOfArg(0); |
| 199 | int typeId = gen->GetArgTypeId(0); |
| 200 | |
| 201 | asIScriptContext* ctx = asGetActiveContext(); |
| 202 | asIScriptEngine* engine = ctx->GetEngine(); |
| 203 | asITypeInfo* ti = engine->GetTypeInfoById(typeId); |
| 204 | asIScriptFunction* func = ti->GetMethodByName("get_value"); |
| 205 | ctx->PushState(); |
| 206 | ctx->Prepare(func); |
| 207 | if (typeId & asTYPEID_OBJHANDLE) |
| 208 | ptr = *(void**)ptr; |
| 209 | ctx->SetObject(ptr); //##Crash! |
| 210 | ctx->Execute(); |
| 211 | printResult << ctx->GetReturnDWord() << "\n"; |
| 212 | ctx->PopState(); |
| 213 | } |
| 214 | |
| 215 | static bool testVal = false; |
| 216 | static bool called = false; |
nothing calls this directly
no test coverage detected