From 51acf8abb5b8f4a698175d55f7e0b3aacc2032e6 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 2 Feb 2009 17:34:44 +0000 Subject: [PATCH] Made sure to change the abbreviation for VAL array things that are now being assigned to via a loop as initialisation --- transformations/SimplifyExprs.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/transformations/SimplifyExprs.hs b/transformations/SimplifyExprs.hs index ef9e3e9..2b10079 100644 --- a/transformations/SimplifyExprs.hs +++ b/transformations/SimplifyExprs.hs @@ -219,6 +219,12 @@ transformConstr = pass "Transform array constructors into initialisation code" let indexVar = A.Variable m'' indexName tInner <- trivialSubscriptType m t + + -- To avoid confusion in later passes, we must change the abbreviation + -- mode for this thing from ValAbbrev (which it must have been) + -- to Original, since we are now actually declaring it and assigning + -- to it: + modifyName n $ \nd -> nd {A.ndAbbrevMode = A.Original} return $ declDest $ A.ProcThen m'' (A.Seq m'' $ A.Spec m'' indexVarSpec $