From 76aeabe7471dcfbc7ebbef64758817054ab1c9b8 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sun, 9 Mar 2008 18:54:37 +0000 Subject: [PATCH] Fixed genRetypesSizes to work properly again with arrays with a non-fixed dimension (oops) --- backends/GenerateC.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backends/GenerateC.hs b/backends/GenerateC.hs index c0118a7..dbeef38 100644 --- a/backends/GenerateC.hs +++ b/backends/GenerateC.hs @@ -1047,7 +1047,13 @@ cgenRetypeSizes m destT destN srcT srcV call genBytesIn m destT (Left True) tell [","] genMeta m - tell [")"] in + tell [")"] + isVarArray = case destT of + A.Array ds _ -> A.UnknownDimension `elem` ds + _ -> False in + if isVarArray + then size >> tell [";"] + else do tell ["if("] size tell ["!=1){"]