Hi,
I have found an issue with the angelscript engine that erases the value register when it is not supposed to, which causes a problem when using the JIT developed by BlindMind studios (see this thread). I guess it may also have other side effects in some other cases, so you might want to fix it.
Please find below a patch proposal:
--- angelscript/source/as_callfunc.cpp (AS 2.29 WIP)
+++ angelscript/source/as_callfunc.cpp (working copy)
@@ -672,7 +672,7 @@
*(asDWORD*)&context->m_regs.valueRegister = (asDWORD)retQW;
#endif
}
- else
+ else if( sysFunc->hostReturnSize == 2 )
context->m_regs.valueRegister = retQW;
}
It simply verifies that hostReturnSize is appropriate before copying data to the value register. Without this line, a function that does NOT return anything will actually erase the value register with garbage...
Please tell me if this makes sense...