From 6742cab794e7481b11480ad61803b4642b9db2ca Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 16 Jun 2018 22:12:40 +0300 Subject: [PATCH] Restrict minimum non-zero JIT cache size. --- include/newcpu.h | 1 + main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/newcpu.h b/include/newcpu.h index 27a903e0..0ef777c7 100644 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -66,6 +66,7 @@ struct cputbl { }; #ifdef JIT +#define MIN_JIT_CACHE 128 #define MAX_JIT_CACHE 16384 typedef uae_u32 REGPARAM3 compop_func (uae_u32) REGPARAM; diff --git a/main.cpp b/main.cpp index fe59461f..c25f2a42 100644 --- a/main.cpp +++ b/main.cpp @@ -573,8 +573,8 @@ void fixup_prefs (struct uae_prefs *p, bool userconfig) p->comptrustnaddr = 1; err = 1; } - if (p->cachesize < 0 || p->cachesize > 16384) { - error_log (_T("Bad value for cachesize parameter: value must be within 0..16384.")); + if (p->cachesize < 0 || p->cachesize > MAX_JIT_CACHE || (p->cachesize > 0 && p->cachesize < MIN_JIT_CACHE)) { + error_log (_T("Bad value for cachesize parameter: value must zero or within %d..%d."), MIN_JIT_CACHE, MAX_JIT_CACHE); p->cachesize = 0; err = 1; } -- 2.47.3