summaryrefslogtreecommitdiff
path: root/sljit/sljitNativeX86_common.c
diff options
context:
space:
mode:
authorzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-12-03 07:58:30 +0000
committerzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-12-03 07:58:30 +0000
commitad1a6e3a96050e61e6e2127d3a00ded77a1eb80c (patch)
tree4987dde0d6b3aee6401d3e89ce6ddc3acef49df3 /sljit/sljitNativeX86_common.c
parentc9fa02b130f1a9da7b17b915e75248f19afb6d7a (diff)
downloadpcre-ad1a6e3a96050e61e6e2127d3a00ded77a1eb80c.tar.gz
renaming utf8 to utf, JIT compiler update, disallowing invalid utf chars
git-svn-id: svn://vcs.exim.org/pcre/code/branches/pcre16@781 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'sljit/sljitNativeX86_common.c')
-rw-r--r--sljit/sljitNativeX86_common.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sljit/sljitNativeX86_common.c b/sljit/sljitNativeX86_common.c
index c6661bc..cc215a2 100644
--- a/sljit/sljitNativeX86_common.c
+++ b/sljit/sljitNativeX86_common.c
@@ -357,22 +357,22 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
while (jump) {
if (jump->flags & PATCH_MB) {
SLJIT_ASSERT((sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_b))) >= -128 && (sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_b))) <= 127);
- *(sljit_ub*)jump->addr = jump->u.label->addr - (jump->addr + sizeof(sljit_b));
+ *(sljit_ub*)jump->addr = (sljit_ub)(jump->u.label->addr - (jump->addr + sizeof(sljit_b)));
} else if (jump->flags & PATCH_MW) {
if (jump->flags & JUMP_LABEL) {
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- *(sljit_w*)jump->addr = jump->u.label->addr - (jump->addr + sizeof(sljit_w));
+ *(sljit_w*)jump->addr = (sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_w)));
#else
SLJIT_ASSERT((sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_hw))) >= -0x80000000ll && (sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_hw))) <= 0x7fffffffll);
- *(sljit_hw*)jump->addr = jump->u.label->addr - (jump->addr + sizeof(sljit_hw));
+ *(sljit_hw*)jump->addr = (sljit_hw)(jump->u.label->addr - (jump->addr + sizeof(sljit_hw)));
#endif
}
else {
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- *(sljit_w*)jump->addr = jump->u.target - (jump->addr + sizeof(sljit_w));
+ *(sljit_w*)jump->addr = (sljit_w)(jump->u.target - (jump->addr + sizeof(sljit_w)));
#else
SLJIT_ASSERT((sljit_w)(jump->u.target - (jump->addr + sizeof(sljit_hw))) >= -0x80000000ll && (sljit_w)(jump->u.target - (jump->addr + sizeof(sljit_hw))) <= 0x7fffffffll);
- *(sljit_hw*)jump->addr = jump->u.target - (jump->addr + sizeof(sljit_hw));
+ *(sljit_hw*)jump->addr = (sljit_hw)(jump->u.target - (jump->addr + sizeof(sljit_hw)));
#endif
}
}
@@ -387,6 +387,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
/* Maybe we waste some space because of short jumps. */
SLJIT_ASSERT(code_ptr <= code + compiler->size);
compiler->error = SLJIT_ERR_COMPILED;
+ compiler->executable_size = compiler->size;
return (void*)code;
}
@@ -1360,7 +1361,7 @@ static int emit_mul(struct sljit_compiler *compiler,
code = (sljit_ub*)ensure_buf(compiler, 1 + 4);
FAIL_IF(!code);
INC_CSIZE(4);
- *(sljit_hw*)code = src1w;
+ *(sljit_hw*)code = (sljit_hw)src1w;
}
else {
EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, src1w);
@@ -1403,7 +1404,7 @@ static int emit_mul(struct sljit_compiler *compiler,
code = (sljit_ub*)ensure_buf(compiler, 1 + 4);
FAIL_IF(!code);
INC_CSIZE(4);
- *(sljit_hw*)code = src2w;
+ *(sljit_hw*)code = (sljit_hw)src2w;
}
else {
EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, src1w);