Skip to content

Commit f1f572a

Browse files
committed
[DYNAREC] Only call getProtection once in FillBlock64
1 parent 8e96a34 commit f1f572a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/dynarec/dynarec_native.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,9 @@ dynablock_t* FillBlock64(uintptr_t addr, int is32bits, int inst_max, int is_new,
473473
dynarec_log(LOG_DEBUG, "Not creating dynablock at %p as in a HotPage\n", (void*)addr);
474474
return NULL;
475475
}
476+
uint32_t prot = getProtection_fast(addr);
476477
#ifndef _WIN32
477-
if((getProtection_fast(addr)&req_prot)!=req_prot) {// cannot be run, get out of the Dynarec
478+
if((prot&req_prot)!=req_prot) {// cannot be run, get out of the Dynarec
478479
dynarec_log(LOG_DEBUG, "Not creating dynablock at %p because EXEC protection is missing\n", (void*)addr);
479480
return NULL;
480481
}
@@ -512,7 +513,7 @@ dynablock_t* FillBlock64(uintptr_t addr, int is32bits, int inst_max, int is_new,
512513
helper.next_cap = MAX_INSTS;
513514
helper.table64 = NULL;
514515
helper.env = GetCurEnvByAddr(addr);
515-
if(getProtection(addr)&PROT_NEVERCLEAN) {
516+
if(prot&PROT_NEVERCLEAN) {
516517
helper.always_test = 1;
517518
}
518519
ResetTable64(&helper);

0 commit comments

Comments
 (0)