aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/CryptonightR_JIT.c
diff options
context:
space:
mode:
authorselene <selene@users.noreply.github.com>2019-07-03 12:15:35 +0100
committerselene <selene@i2pmail.org>2019-07-04 12:49:54 +0100
commitc393e824d6a571f969088d9bd99c5a899fbee353 (patch)
tree6707c94f5253cbfa2c7ae0e81267566c95c17551 /src/crypto/CryptonightR_JIT.c
parentMerge pull request #5681 (diff)
downloadmonero-c393e824d6a571f969088d9bd99c5a899fbee353.tar.xz
CryptonightR_JIT: fix return value on error
The value was positive rather than zero, but the caller only checks for negative errors
Diffstat (limited to 'src/crypto/CryptonightR_JIT.c')
-rw-r--r--src/crypto/CryptonightR_JIT.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/crypto/CryptonightR_JIT.c b/src/crypto/CryptonightR_JIT.c
index ee8f3f36f..ffe7820a2 100644
--- a/src/crypto/CryptonightR_JIT.c
+++ b/src/crypto/CryptonightR_JIT.c
@@ -63,7 +63,7 @@ int v4_generate_JIT_code(const struct V4_Instruction* code, v4_random_math_JIT_f
#if !(defined(_MSC_VER) || defined(__MINGW32__))
if (mprotect((void*)buf, buf_size, PROT_READ | PROT_WRITE))
- return 1;
+ return -1;
#endif
APPEND_CODE(prologue, sizeof(prologue));
@@ -111,13 +111,13 @@ int v4_generate_JIT_code(const struct V4_Instruction* code, v4_random_math_JIT_f
#if !(defined(_MSC_VER) || defined(__MINGW32__))
if (mprotect((void*)buf, buf_size, PROT_READ | PROT_EXEC))
- return 1;
+ return -1;
#endif
__builtin___clear_cache((char*)buf, (char*)JIT_code);
return 0;
#else
- return 1;
+ return -1;
#endif
}