diff --git a/src/library/compiler/csimp.cpp b/src/library/compiler/csimp.cpp index ccb9dc68e9..98d489869a 100644 --- a/src/library/compiler/csimp.cpp +++ b/src/library/compiler/csimp.cpp @@ -1580,13 +1580,13 @@ class csimp_fn { } else if (is_constant(fn)) { unsigned nargs = get_app_num_args(e); if (nargs == 1) { - expr a1 = find(app_arg(e)); + expr a1 = find(visit_arg(app_arg(e))); if (optional r = fold_un_op(m_before_erasure, fn, a1)) { return *r; } } else if (nargs == 2) { - expr a1 = find(app_arg(app_fn(e))); - expr a2 = find(app_arg(e)); + expr a1 = find(visit_arg(app_arg(app_fn(e)))); + expr a2 = find(visit_arg(app_arg(e))); if (optional r = fold_bin_op(m_before_erasure, fn, a1, a2)) { return *r; }