mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
- removed the no longer needed exception prevention hack.
# Conflicts: # src/scripting/vm/vmframe.cpp
This commit is contained in:
parent
067e9de00a
commit
85a3edf583
4 changed files with 7 additions and 46 deletions
|
@ -173,7 +173,6 @@ void I_FatalError(const char* const error, ...)
|
|||
|
||||
}
|
||||
|
||||
extern thread_local int jit_frames;
|
||||
void I_Error (const char *error, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
|
@ -181,17 +180,9 @@ void I_Error (const char *error, ...)
|
|||
|
||||
va_start(argptr, error);
|
||||
|
||||
if (jit_frames == 0)
|
||||
{
|
||||
vsprintf (errortext, error, argptr);
|
||||
va_end (argptr);
|
||||
throw CRecoverableError(errortext);
|
||||
}
|
||||
else
|
||||
{
|
||||
I_FatalError(error, argptr);
|
||||
va_end(argptr);
|
||||
}
|
||||
vsprintf (errortext, error, argptr);
|
||||
va_end (argptr);
|
||||
throw CRecoverableError(errortext);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -220,7 +220,6 @@ void I_FatalError(const char* const error, ...)
|
|||
|
||||
}
|
||||
|
||||
extern thread_local int jit_frames;
|
||||
void I_Error (const char *error, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
|
@ -228,17 +227,9 @@ void I_Error (const char *error, ...)
|
|||
|
||||
va_start(argptr, error);
|
||||
|
||||
if (jit_frames == 0)
|
||||
{
|
||||
vsprintf (errortext, error, argptr);
|
||||
va_end (argptr);
|
||||
throw CRecoverableError(errortext);
|
||||
}
|
||||
else
|
||||
{
|
||||
I_FatalError(error, argptr);
|
||||
va_end(argptr);
|
||||
}
|
||||
vsprintf (errortext, error, argptr);
|
||||
va_end (argptr);
|
||||
throw CRecoverableError(errortext);
|
||||
}
|
||||
|
||||
void I_SetIWADInfo ()
|
||||
|
|
|
@ -58,17 +58,6 @@ CUSTOM_CVAR(Bool, vm_jit, true, CVAR_NOINITCALL)
|
|||
CVAR(Bool, vm_jit, false, CVAR_NOINITCALL|CVAR_NOSET)
|
||||
#endif
|
||||
|
||||
// On Windows we can rely on the system's unwinder to deal with JITed code.
|
||||
// On Linux we can not and need to be able to tell the error management that we have some JITed code in the call chain.
|
||||
#ifdef _WIN32
|
||||
inline void beginVM() { }
|
||||
inline void endVM() { }
|
||||
#else
|
||||
thread_local int jit_frames;
|
||||
inline void beginVM() { if (vm_jit) jit_frames++; }
|
||||
inline void endVM() { if (vm_jit) jit_frames--; }
|
||||
#endif
|
||||
|
||||
cycle_t VMCycles[10];
|
||||
int VMCalls[10];
|
||||
|
||||
|
@ -581,9 +570,7 @@ int VMCall(VMFunction *func, VMValue *params, int numparams, VMReturn *results,
|
|||
VMCycles[0].Clock();
|
||||
|
||||
auto sfunc = static_cast<VMScriptFunction *>(func);
|
||||
beginVM();
|
||||
int numret = sfunc->ScriptCall(sfunc, params, numparams, results, numresults);
|
||||
endVM();
|
||||
VMCycles[0].Unclock();
|
||||
return numret;
|
||||
}
|
||||
|
@ -702,15 +689,6 @@ void ThrowAbortException(VMScriptFunction *sfunc, VMOP *line, EVMAbortException
|
|||
|
||||
CVMAbortException err(reason, moreinfo, ap);
|
||||
|
||||
#ifndef _WIN32)
|
||||
|
||||
// Without a usable unwinder, aborting is the only real option here. :(
|
||||
if (jit_frames)
|
||||
{
|
||||
I_FatalError("VM error: %s", err.what());
|
||||
}
|
||||
#endif
|
||||
|
||||
err.stacktrace.AppendFormat("Called from %s at %s, line %d\n", sfunc->PrintableName.GetChars(), sfunc->SourceFileName.GetChars(), sfunc->PCToLine(line));
|
||||
throw err;
|
||||
va_end(ap);
|
||||
|
|
|
@ -506,6 +506,7 @@ DEFINE_ACTION_FUNCTION(DBrokenLines, StringWidth)
|
|||
|
||||
DEFINE_ACTION_FUNCTION(DBrokenLines, StringAt)
|
||||
{
|
||||
|
||||
PARAM_SELF_PROLOGUE(DBrokenLines);
|
||||
PARAM_INT(index);
|
||||
ACTION_RETURN_STRING((unsigned)index >= self->mBroken.Size() ? -1 : self->mBroken[index].Text);
|
||||
|
|
Loading…
Reference in a new issue