Browse Source

[Pal/Linux-SGX] Update enclave_{base,top} only once

The code already tried to do this but if enclave_base == 0 it
recalcuates enclave_top every time.
Simon Gaiser 6 years ago
parent
commit
f883489356
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Pal/src/host/Linux-SGX/enclave_ecalls.c

+ 1 - 1
Pal/src/host/Linux-SGX/enclave_ecalls.c

@@ -23,7 +23,7 @@ int handle_ecall (long ecall_index, void * ecall_args, void * exit_target,
     if (ecall_index < 0 || ecall_index >= ECALL_NR)
         return -PAL_ERROR_INVAL;
 
-    if (!enclave_base) {
+    if (!enclave_top) {
         enclave_base = enclave_base_addr;
         enclave_top = enclave_base_addr + GET_ENCLAVE_TLS(enclave_size);
     }