Fix error in const pointer load on ARM64 code generator

The mcp value in mcpofs is pointing to previous position of machine
code. So the real offset between pc and test pointer should be 1 more
than the difference between mcp and test pointer.

Change-Id: I7d3fbc3371b295deb7566795fdabf77467306791
This commit is contained in:
Zhongwei Yao 2016-12-01 18:05:38 +08:00
parent 3ad2bbf586
commit d2e7ce5714

View File

@ -234,7 +234,7 @@ static void emit_loadk(ASMState *as, Reg rd, uint64_t u64, int is64)
#define glofs(as, k) \ #define glofs(as, k) \
((intptr_t)((uintptr_t)(k) - (uintptr_t)&J2GG(as->J)->g)) ((intptr_t)((uintptr_t)(k) - (uintptr_t)&J2GG(as->J)->g))
#define mcpofs(as, k) \ #define mcpofs(as, k) \
((intptr_t)((uintptr_t)(k) - (uintptr_t)as->mcp)) ((intptr_t)((uintptr_t)(k) - (uintptr_t)(as->mcp - 1)))
#define checkmcpofs(as, k) \ #define checkmcpofs(as, k) \
((((mcpofs(as, k)>>2) + 0x00040000) >> 19) == 0) ((((mcpofs(as, k)>>2) + 0x00040000) >> 19) == 0)