SmartCMD icon indicating copy to clipboard operation
SmartCMD copied to clipboard

Does SmartCMD work with JIT?

Open Zelyutin opened this issue 7 years ago • 3 comments

As I see, there's a lot #emit instructions in the smartcmd, so probably it won't work with JIT cause of memory hacking or something like this. Am I right or is there a way to make them work together?

Zelyutin avatar Jun 20 '18 13:06 Zelyutin

I don't get why using #emit would prevent it from working with JIT. All your PAWN code is ultimately converted to instructions in the AMX binary. It makes no difference whether you write code using inline assembly or PAWN code. The JIT compiler will convert the AMX instructions into the native machine code.

I haven't tested but I see no reason why it shouldn't work.

YashasSamaga avatar Jun 21 '18 14:06 YashasSamaga

#emit on its own doesn't prevent JIT, but certain non-standard uses of it may. Mainly emit code that modifies other code.

Y-Less avatar Jun 21 '18 15:06 Y-Less

Thank you for your answers! Of course, #emit by itself doesn't, I understand it perfectly. But the only 2 includes that crash my server after enabling JIT is Pointers by Slice and SmartCMD as it seems. I was ready to easily remove pointers, but your system is valuable and useful for me.

So' I've tried to use almost empty gamemode with one command:

#include "../vendor/samp_basic/a_samp.inc"

#include "../vendor/smartcmd.inc"

CMD:veh(cmdid, playerid, params[])
{
	new Float:X,Float:Y,Float:Z;
	GetPlayerPos(playerid, X,Y,Z);
	CreateVehicle(411, X,Y,Z, 0, 0, 0, 0);
	return CMD_SUCCESS;
}

main()
{
	
}

And JIT is the only plugin connected to the server.

As the result, server crashes right after /veh written in the chatbox, and it's very sad.

By the way, this thing had pushed me to the idea of writing the mode in C++ with SampGDK, so, thank you for this, anyway)

Zelyutin avatar Jun 21 '18 18:06 Zelyutin