From 7cfe69995b7186b6649624a3052a0597ce67d55f 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

(manually cherry picked from commit 9525dbe3a88de10878755bef642774b6a77c6d7a)
---
 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 d2f0f5d8e1..3914df507c 100644
--- a/mex/sources/bytecode/bytecode.cc
+++ b/mex/sources/bytecode/bytecode.cc
@@ -683,10 +683,10 @@ mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
     mexWarnMsgTxt("Not enough space. Filename is truncated.");
   string file_name = 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\n");
 
-  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\n");
 
   size_t size_of_direction = col_y*row_y*sizeof(double);
-- 
GitLab