diff --git a/core/DebugReporter.cpp b/core/DebugReporter.cpp index ed8a6bd2..9452f560 100644 --- a/core/DebugReporter.cpp +++ b/core/DebugReporter.cpp @@ -68,7 +68,7 @@ void DebugReport::GenerateError(IPluginContext *ctx, cell_t func_idx, int err, c { func_idx >>= 1; sp_public_t *function; - if (ctx->GetPublicByIndex(func_idx, &function) == SP_ERROR_NONE) + if (ctx->GetRuntime()->GetPublicByIndex(func_idx, &function) == SP_ERROR_NONE) { g_Logger.LogError("[SM] Unable to call function \"%s\" due to above error(s).", function->name); } @@ -98,7 +98,7 @@ void DebugReport::GenerateCodeError(IPluginContext *pContext, uint32_t code_addr g_Logger.LogError("[SM] %s", buffer); IPluginDebugInfo *pDebug; - if ((pDebug = pContext->GetDebugInfo()) == NULL) + if ((pDebug = pContext->GetRuntime()->GetDebugInfo()) == NULL) { g_Logger.LogError("[SM] Debug mode is not enabled for \"%s\"", plname); g_Logger.LogError("[SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug %d on", diff --git a/sourcepawn/jit/BaseRuntime.cpp b/sourcepawn/jit/BaseRuntime.cpp index 3d7cc402..76aa9c5b 100644 --- a/sourcepawn/jit/BaseRuntime.cpp +++ b/sourcepawn/jit/BaseRuntime.cpp @@ -47,6 +47,7 @@ BaseRuntime::~BaseRuntime() free(m_pPlugin->base); delete [] m_pPlugin->memory; + delete [] m_pPlugin->natives; delete m_pPlugin; } diff --git a/sourcepawn/jit/sp_vm_engine.cpp b/sourcepawn/jit/sp_vm_engine.cpp index 944170b5..158da04b 100644 --- a/sourcepawn/jit/sp_vm_engine.cpp +++ b/sourcepawn/jit/sp_vm_engine.cpp @@ -401,7 +401,7 @@ bool CContextTrace::GetTraceInfo(CallStackInfo *trace) } IPluginContext *pContext = m_pIterator->ctx; - IPluginDebugInfo *pInfo = pContext->GetDebugInfo(); + IPluginDebugInfo *pInfo = pContext->GetRuntime()->GetDebugInfo(); if (!pInfo) { diff --git a/sourcepawn/jit/x86/jit_x86.cpp b/sourcepawn/jit/x86/jit_x86.cpp index f8bb89ee..db108b48 100644 --- a/sourcepawn/jit/x86/jit_x86.cpp +++ b/sourcepawn/jit/x86/jit_x86.cpp @@ -2684,7 +2684,7 @@ jit_rewind: ctx->n_err = SP_ERROR_NONE; ctx->n_idx = SP_ERROR_NONE; plugin->prof_flags = data->profile; - plugin->flags = data->debug ? SPFLAG_PLUGIN_DEBUG : 0; + plugin->run_flags = data->debug ? SPFLAG_PLUGIN_DEBUG : 0; const char *strbase = plugin->info.stringbase; uint32_t max, iter; @@ -2717,7 +2717,8 @@ jit_rewind: } /* relocate native info */ - if ((max = plugin->info.natives_num)) + if ((max = plugin->info.natives_num) + && plugin->natives == NULL) { plugin->natives = new sp_native_t[max]; plugin->jit_memsize += sizeof(sp_native_t) * max; @@ -2995,7 +2996,6 @@ void JITX86::FreePluginVars(sp_plugin_t *pl) { delete [] pl->files; delete [] pl->lines; - delete [] pl->natives; delete [] pl->publics; delete [] pl->pubvars; delete [] pl->symbols; @@ -3008,7 +3008,6 @@ void JITX86::FreePluginVars(sp_plugin_t *pl) pl->files = NULL; pl->lines = NULL; - pl->natives = NULL; pl->publics = NULL; pl->pubvars = NULL; pl->symbols = NULL;