From 4a6bce6ee456f18fc6dbdffe79597a3ecd2f8856 Mon Sep 17 00:00:00 2001 From: johnvg Date: Tue, 4 Sep 2007 10:48:19 +0000 Subject: 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 git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1682 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- backendC/CleanCompilerSources/sa.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'backendC') diff --git a/backendC/CleanCompilerSources/sa.c b/backendC/CleanCompilerSources/sa.c index ca777d4..d253898 100644 --- a/backendC/CleanCompilerSources/sa.c +++ b/backendC/CleanCompilerSources/sa.c @@ -3833,6 +3833,12 @@ static Bool ReduceDepExpression (Exp e, Path p, Context context) for (i = 0; i < arity; i++){ if (ReduceInContext (& e->e_args[i], p, NewSimpleContext (HnfStrict, context->context_speculative))) 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); -- cgit v1.2.3