author | pcpa <paulo.cesar.pereira.de.andrade@gmail.com> | 2023年08月16日 09:59:48 -0300 |
---|---|---|
committer | pcpa <paulo.cesar.pereira.de.andrade@gmail.com> | 2023年08月16日 09:59:48 -0300 |
commit | 3d72aba731677c1c262692a584bd41b6b12c792e (patch) | |
tree | cf383fa7b50f94231c29e1f0c1fbac1d1bacdf7f /lib | |
parent | 60254fb663d71c4d3bf81e7dca6d7d940ec99934 (diff) | |
download | lightning-3d72aba731677c1c262692a584bd41b6b12c792e.tar.gz |
-rw-r--r-- | lib/jit_x86-cpu.c | 4 | ||||
-rw-r--r-- | lib/lightning.c | 10 |
diff --git a/lib/jit_x86-cpu.c b/lib/jit_x86-cpu.c index e185d14..47529cf 100644 --- a/lib/jit_x86-cpu.c +++ b/lib/jit_x86-cpu.c @@ -50,8 +50,8 @@ # define stxr(u, v, w) stxr_l(u, v, w) # define stxi(u, v, w) stxi_l(u, v, w) # define can_sign_extend_int_p(im) \ - (((im) >= 0 && (long long)(im) <= 0x7fffffffLL) || \ - ((im) < 0 && (long long)(im) > -0x80000000LL)) + (((long long)(im) >= 0 && (long long)(im) <= 0x7fffffffLL) || \ + ((long long)(im) < 0 && (long long)(im) > -0x80000000LL)) # define can_zero_extend_int_p(im) \ ((im) >= 0 && (im) < 0x80000000LL) # define fits_uint32_p(im) (((im) & 0xffffffff00000000LL) == 0) diff --git a/lib/lightning.c b/lib/lightning.c index 3d98663..d1d8ffc 100644 --- a/lib/lightning.c +++ b/lib/lightning.c @@ -2553,12 +2553,12 @@ _jit_emit(jit_state_t *_jit) assert(result == 0); } if (!_jit->user_code) { - _jit->code.protected = _jit->pc.uc - _jit->code.ptr; + _jit->code.protect = _jit->pc.uc - _jit->code.ptr; # if __riscv && __WORDSIZE == 64 /* FIXME should start adding consts at a page boundary */ - _jit->code.protected -= _jitc->consts.hash.count * sizeof(jit_word_t); + _jit->code.protect -= _jitc->consts.hash.count * sizeof(jit_word_t); # endif - result = mprotect(_jit->code.ptr, _jit->code.protected, PROT_READ | PROT_EXEC); + result = mprotect(_jit->code.ptr, _jit->code.protect, PROT_READ | PROT_EXEC); assert(result == 0); } #endif /* HAVE_MMAP */ @@ -2576,7 +2576,7 @@ _jit_protect(jit_state_t *_jit) #else int result; if (_jit->user_code) return; - result = mprotect (_jit->code.ptr, _jit->code.protected, PROT_READ | PROT_EXEC); + result = mprotect (_jit->code.ptr, _jit->code.protect, PROT_READ | PROT_EXEC); assert (result == 0); #endif } @@ -2589,7 +2589,7 @@ _jit_unprotect(jit_state_t *_jit) #else int result; if (_jit->user_code) return; - result = mprotect (_jit->code.ptr, _jit->code.protected, PROT_READ | PROT_WRITE); + result = mprotect (_jit->code.ptr, _jit->code.protect, PROT_READ | PROT_WRITE); assert (result == 0); #endif } |