From fc88e371ce3960f77b6878c6d5288d0ed33c43ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Fri, 16 Apr 2021 17:36:08 +0200 Subject: [PATCH] Preprocessor: fix crash in DataTree::operator=() with model local variables Also add a regression test. Closes: #1782 Preprocessor: also fix writeJsonOutput for load_params_and_steady_state (manually cherry picked from commit caef9e266b4f78b238d12ca138e22c6f9adaa881) --- preprocessor | 2 +- tests/example1_mlv.mod | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/preprocessor b/preprocessor index e516f39246..72a63752b1 160000 --- a/preprocessor +++ b/preprocessor @@ -1 +1 @@ -Subproject commit e516f392469208d6a5162c3749640f1e19dd193e +Subproject commit 72a63752b1b1f5efd4ecadff1603884e5693b883 diff --git a/tests/example1_mlv.mod b/tests/example1_mlv.mod index 19b3608ed0..ea9dbf029c 100644 --- a/tests/example1_mlv.mod +++ b/tests/example1_mlv.mod @@ -16,8 +16,14 @@ theta = 2.95; phi = 0.1; +/* The following statement is a regression test for #1782. + Here the “foo” variable definition depends on “bar”, but the symbol ID of + “foo” will be smaller than the symbol ID of “bar”. */ +model_local_variable foo $\text{foo}$; + model; -#foo = (exp(b)*c)/(exp(b(+1))*c(+1)); +#bar = exp(b)*c; +#foo = bar/(exp(b(+1))*c(+1)); c*theta*h^(1+psi)=(1-alpha)*y; k = beta*(foo *(exp(b(+1))*alpha*y(+1)+(1-delta)*k)); -- GitLab