From 9525dbe3a88de10878755bef642774b6a77c6d7a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Tue, 10 Oct 2023 17:32:33 -0400
Subject: [PATCH] Bytecode: do not restrict
 print_bytecode_{static,dynamic}_model to certain values of
 {stack_,}solve_algo

---
 mex/sources/bytecode/bytecode.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mex/sources/bytecode/bytecode.cc b/mex/sources/bytecode/bytecode.cc
index f34e1e46f0..14282169c8 100644
--- a/mex/sources/bytecode/bytecode.cc
+++ b/mex/sources/bytecode/bytecode.cc
@@ -545,10 +545,10 @@ mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
   string file_name = fname;
   mxFree(fname);
 
-  if (stack_solve_algo == 7 && !steady_state)
+  if (stack_solve_algo == 7 && !steady_state && !print)
     mexErrMsgTxt("Bytecode: Can't use option stack_solve_algo=7");
 
-  if (steady_state && !evaluate && (solve_algo < 5 || solve_algo > 8))
+  if (steady_state && !evaluate && !print && (solve_algo < 5 || solve_algo > 8))
     mexErrMsgTxt("Bytecode: solve_algo must be between 5 and 8 when using the internal steady state solver");
 
   size_t size_of_direction = col_y*row_y*sizeof(double);
-- 
GitLab