From 58fb815f329b92fc8cb71ebaa9ccbc0db8e23620 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Mon, 20 May 2024 10:34:23 +0200 Subject: [PATCH] fixes gen_raise in tcc --- gen_input/templates/tcc/CORENAME.cpp.gtl | 2 +- src/vm/tcc/vm_tgc5c.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gen_input/templates/tcc/CORENAME.cpp.gtl b/gen_input/templates/tcc/CORENAME.cpp.gtl index e378bb6..f9ee677 100644 --- a/gen_input/templates/tcc/CORENAME.cpp.gtl +++ b/gen_input/templates/tcc/CORENAME.cpp.gtl @@ -292,7 +292,7 @@ vm_impl::gen_single_inst_behavior(virt_addr_t &pc, unsigned int &inst_cnt, template void vm_impl::gen_raise_trap(tu_builder& tu, uint16_t trap_id, uint16_t cause) { tu(" *trap_state = {:#x};", 0x80 << 24 | (cause << 16) | trap_id); - tu.store(traits::LAST_BRANCH, tu.constant(std::numeric_limits::max(), 32)); + tu.store(traits::NEXT_PC, tu.constant(std::numeric_limits::max(), 32)); } template void vm_impl::gen_leave_trap(tu_builder& tu, unsigned lvl) { diff --git a/src/vm/tcc/vm_tgc5c.cpp b/src/vm/tcc/vm_tgc5c.cpp index 88c7e9d..77033cd 100644 --- a/src/vm/tcc/vm_tgc5c.cpp +++ b/src/vm/tcc/vm_tgc5c.cpp @@ -3611,7 +3611,7 @@ vm_impl::gen_single_inst_behavior(virt_addr_t &pc, unsigned int &inst_cnt, template void vm_impl::gen_raise_trap(tu_builder& tu, uint16_t trap_id, uint16_t cause) { tu(" *trap_state = {:#x};", 0x80 << 24 | (cause << 16) | trap_id); - tu.store(traits::LAST_BRANCH, tu.constant(std::numeric_limits::max(), 32)); + tu.store(traits::NEXT_PC, tu.constant(std::numeric_limits::max(), 32)); } template void vm_impl::gen_leave_trap(tu_builder& tu, unsigned lvl) {