From b9df616c18fdb03749fccbce90efbc813b8e1f07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Fri, 13 Dec 2013 16:49:00 +0100
Subject: [PATCH] Fix treatment of error conditions in bytecode.

---
 matlab/simul.m | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/matlab/simul.m b/matlab/simul.m
index d79570469..4285c906d 100644
--- a/matlab/simul.m
+++ b/matlab/simul.m
@@ -110,6 +110,11 @@ if(options_.block)
 else
     if(options_.bytecode)
         [info, oo_.endo_simul]=bytecode('dynamic');
+        if info == 1
+            oo_.deterministic_simulation.status = 0;
+        else
+            oo_.deterministic_simulation.status = 1;
+        end;
         mexErrCheck('bytecode', info);
     else
         if M_.maximum_endo_lead == 0 % Purely backward model
@@ -129,4 +134,4 @@ end
 dyn2vec;
 
 ts = dseries(transpose(oo_.endo_simul),options_.initial_period,cellstr(M_.endo_names));
-assignin('base', 'Simulated_time_series', ts);
\ No newline at end of file
+assignin('base', 'Simulated_time_series', ts);
-- 
GitLab