aboutsummaryrefslogtreecommitdiff
path: root/backendC
diff options
context:
space:
mode:
authorjohnvg2007-09-04 10:48:19 +0000
committerjohnvg2007-09-04 10:48:19 +0000
commit4a6bce6ee456f18fc6dbdffe79597a3ecd2f8856 (patch)
tree3ade200cb8508d9876d9509cb3b9095b18afeb9c /backendC
parentadd ( , and ) in type string of .record to print unboxed tuples in constructo... (diff)
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
Diffstat (limited to 'backendC')
-rw-r--r--backendC/CleanCompilerSources/sa.c6
1 files changed, 6 insertions, 0 deletions
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);