diff --git a/fco2/GenerateC.hs b/fco2/GenerateC.hs index d7a10be..cca59c7 100644 --- a/fco2/GenerateC.hs +++ b/fco2/GenerateC.hs @@ -259,10 +259,13 @@ genVariable v = do ps <- get am <- checkJust $ abbrevModeOfVariable ps v t <- checkJust $ typeOfVariable ps v + let isSub = case v of + A.Variable _ _ -> False + A.SubscriptedVariable _ _ _ -> True let prefix = case (am, t) of (_, A.Array _ _) -> "" - (A.Original, A.Chan _) -> "&" + (A.Original, A.Chan _) -> if isSub then "" else "&" (A.Abbrev, A.Chan _) -> "" (A.Original, A.UserDataType _) -> "&" (A.Abbrev, A.UserDataType _) -> ""