fix(kernel/declaration): bug at use_untrusted

This commit is contained in:
Leonardo de Moura 2016-06-02 17:40:09 -07:00
parent 801a57dba1
commit f4df90d6ac

View file

@ -107,10 +107,11 @@ static bool use_untrusted(environment const & env, expr const & e) {
for_each(e, [&](expr const & e, unsigned) {
if (found) return false;
if (is_constant(e)) {
declaration const & d = env.get(const_name(e));
if (!d.is_trusted()) {
found = true;
return false;
if (auto d = env.find(const_name(e))) {
if (!d->is_trusted()) {
found = true;
return false;
}
}
}
return true;