@@ -61,7 +61,7 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
61
61
pushed_execution_context = true ;
62
62
}
63
63
64
- auto block = entry_point ?: &executable.basic_blocks .first ();
64
+ m_current_block = entry_point ?: &executable.basic_blocks .first ();
65
65
if (in_frame)
66
66
m_register_windows.append (in_frame);
67
67
else
@@ -70,7 +70,9 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
70
70
registers ().resize (executable.number_of_registers );
71
71
72
72
for (;;) {
73
- Bytecode::InstructionStreamIterator pc (block->instruction_stream ());
73
+ Bytecode::InstructionStreamIterator pc (m_current_block->instruction_stream ());
74
+ TemporaryChange temp_change { m_pc, &pc };
75
+
74
76
bool will_jump = false ;
75
77
bool will_return = false ;
76
78
while (!pc.at_end ()) {
@@ -85,7 +87,7 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
85
87
if (unwind_context.executable != m_current_executable)
86
88
break ;
87
89
if (unwind_context.handler ) {
88
- block = unwind_context.handler ;
90
+ m_current_block = unwind_context.handler ;
89
91
unwind_context.handler = nullptr ;
90
92
91
93
// If there's no finalizer, there's nowhere for the handler block to unwind to, so the unwind context is no longer needed.
@@ -98,7 +100,7 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
98
100
break ;
99
101
}
100
102
if (unwind_context.finalizer ) {
101
- block = unwind_context.finalizer ;
103
+ m_current_block = unwind_context.finalizer ;
102
104
m_unwind_contexts.take_last ();
103
105
will_jump = true ;
104
106
break ;
@@ -108,7 +110,7 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
108
110
VERIFY_NOT_REACHED ();
109
111
}
110
112
if (m_pending_jump.has_value ()) {
111
- block = m_pending_jump.release_value ();
113
+ m_current_block = m_pending_jump.release_value ();
112
114
will_jump = true ;
113
115
break ;
114
116
}
0 commit comments