Explorar el Código

LibJS: Restore cached current_block on return in Bytecode

Otherwise debug prints will show the wrong block until we preform a jump
Hendiadyoin1 hace 2 años
padre
commit
b86f1c2fe7
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      Userland/Libraries/LibJS/Bytecode/Interpreter.cpp

+ 2 - 1
Userland/Libraries/LibJS/Bytecode/Interpreter.cpp

@@ -61,7 +61,8 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
         pushed_execution_context = true;
     }
 
-    m_current_block = entry_point ?: &executable.basic_blocks.first();
+    TemporaryChange restore_current_block { m_current_block, entry_point ?: &executable.basic_blocks.first() };
+
     if (in_frame)
         m_register_windows.append(in_frame);
     else