e2k: gen exception if call wbs is greater than wsz

This commit is contained in:
Denis Drakhnia 2024-01-02 20:26:10 +02:00
parent 670c781327
commit 624fe3175c
2 changed files with 6 additions and 0 deletions

View File

@ -125,6 +125,8 @@ void cpu_loop(CPUE2KState *env)
stack_expand(env, &env->psp);
break;
case E2K_EXCP_WINDOW_BOUNDS:
gen_signal(env, TARGET_SIGSEGV, TARGET_SEGV_BNDERR, env->ip);
break;
case E2K_EXCP_ARRAY_BOUNDS:
case E2K_EXCP_DATA_PAGE:
gen_signal(env, TARGET_SIGSEGV, TARGET_SEGV_MAPERR, env->ip);

View File

@ -6777,6 +6777,10 @@ static inline void gen_cs1(DisasContext *ctx)
case CS1_SETR:
break;
case CS1_CALL:
if (ctx->w_size < cs1->call_wbs * 2) {
gen_tr_excp_window_bounds(ctx);
}
ctx->ct.type = CT_CALL;
ctx->ct.wbs = cs1->call_wbs;
break;