Declare size arrays before the corresponding real arrays.

This is because we sometimes need the size array while initialising the real
array -- for example, if we're initialising a 2D array of channels.
This commit is contained in:
Adam Sampson 2008-03-12 15:14:00 +00:00
parent d7333e4479
commit 006559271d

View File

@ -212,7 +212,7 @@ declareSizesArray = doGeneric `ext1M` doStructured
defineSizesName m' n_sizes sizeSpecType
return sizeSpec
s' <- doStructured s
return (A.Spec m sp $ A.Spec m sizeSpec $ s')
return (A.Spec m sizeSpec $ A.Spec m sp $ s')
(A.RecordType m _ fs, _) ->
do s' <- doStructured s
fieldDeclarations <- foldM (declareFieldSizes (A.nameName n) m) s' fs