diff --git a/amxmodx/CForward.cpp b/amxmodx/CForward.cpp index 7247b978..a93a6f91 100755 --- a/amxmodx/CForward.cpp +++ b/amxmodx/CForward.cpp @@ -314,10 +314,20 @@ int CForwardMngr::registerSPForward(const char *funcName, AMX *amx, int numParam CSPForward *pForward; if (m_FreeSPForwards.size()) { - retVal = m_FreeSPForwards.back(); - m_FreeSPForwards.pop_back(); - pForward = m_SPForwards[retVal>>1]; // >>1 because unregisterSPForward pushes the id which contains the sp flag - pForward->Set(funcName, amx, numParams, paramTypes); + if (m_SPForwards.size()) + { + retVal = m_FreeSPForwards.back(); + m_FreeSPForwards.pop_back(); + pForward = m_SPForwards[retVal>>1]; // >>1 because unregisterSPForward pushes the id which contains the sp flag + pForward->Set(funcName, amx, numParams, paramTypes); + } else { + m_SPForwards.clear(); + pForward = new CSPForward(); + if (!pForward) + return -1; + pForward->Set(funcName, amx, numParams, paramTypes); + m_SPForwards.push_back(pForward); + } } else { diff --git a/amxmodx/JIT/jits-lineop.o b/amxmodx/JIT/jits-lineop.o new file mode 100755 index 00000000..f15a1b5f Binary files /dev/null and b/amxmodx/JIT/jits-lineop.o differ diff --git a/amxmodx/JIT/jits.asm b/amxmodx/JIT/jits.asm index 455f90d2..a293f0dd 100755 --- a/amxmodx/JIT/jits.asm +++ b/amxmodx/JIT/jits.asm @@ -108,7 +108,7 @@ ; ; GWMV: to generate LINE opcode, %define ALLOWOPLINE ; -%define ALLOWOPLINE +%undef ALLOWOPLINE ; ; If this is set to 1 the JIT generates relocatable code for case tables, too. diff --git a/amxmodx/JIT/jits.o b/amxmodx/JIT/jits.o index f15a1b5f..468efa42 100755 Binary files a/amxmodx/JIT/jits.o and b/amxmodx/JIT/jits.o differ diff --git a/amxmodx/Makefile.pl b/amxmodx/Makefile.pl index b503304c..f74f91bb 100755 --- a/amxmodx/Makefile.pl +++ b/amxmodx/Makefile.pl @@ -14,6 +14,7 @@ # clean - clean the specifications above # asm - for ASM implementation # !! TODO - add memory mananger support +# lineop - for JIT only, uses slow version $PROJECT = "amxmodx_mm"; $sdk = "../hlsdk/SourceCode"; @@ -69,6 +70,8 @@ while ($cmd = shift) } } elsif ($cmd =~ /clean/) { $OPTIONS{"clean"} = 1; + } elsif ($cmd =~ /lineop/) { + $OPTIONS{"lineop"} = 1; } } @@ -175,7 +178,11 @@ for ($i=0; $i<=$#C_SOURCE_FILES; $i++) } if ($OPTIONS{"jit"}) { - push(@LINK, "JIT/jits.o"); + if ($OPTIONS{"lineop"}) { + push(@LINK, "JIT/jits-lineop.o"); + } else { + push(@LINK, "JIT/jits.o"); + } } if ($OPTIONS{"asm"})