Commit 77f2a32c authored by John van Groningen's avatar John van Groningen
Browse files

fix crash for let x=x*x in x, if the first argument of * is updated with Top,

the second argument cannot be used anymore, because x is now Top
parent 91047278
...@@ -3833,6 +3833,12 @@ static Bool ReduceDepExpression (Exp e, Path p, Context context) ...@@ -3833,6 +3833,12 @@ static Bool ReduceDepExpression (Exp e, Path p, Context context)
for (i = 0; i < arity; i++){ for (i = 0; i < arity; i++){
if (ReduceInContext (& e->e_args[i], p, NewSimpleContext (HnfStrict, context->context_speculative))) if (ReduceInContext (& e->e_args[i], p, NewSimpleContext (HnfStrict, context->context_speculative)))
return True; return True;
/* JvG: if an argument is be equal to e (for example: let x=x*x in x),
and ReduceInContext runs out of fuel, e will be updated with Top,
and the rest of the arguments will no longer be valid */
if (e->e_kind!=Dep)
return e->e_kind==Bottom;
/**/
} }
SortExpOfKind (e, Dep); SortExpOfKind (e, Dep);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment