File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ recursiveProductInitBinder insidePath structTy@(StructTy (ConcreteNameTy _) _) [
6363 instanceBinder
6464 (SymPath insidePath " init" )
6565 (FuncTy (initArgListTypes membersXObjs) structTy StaticLifetimeTy )
66- (recursiveProductInit HeapAlloc structTy membersXObjs)
66+ (recursiveProductInit StackAlloc structTy membersXObjs)
6767 (" creates a `" ++ show structTy ++ " `." )
6868 where initArgListTypes :: [XObj ] -> [Ty ]
6969 initArgListTypes xobjs =
@@ -116,7 +116,7 @@ productInitTokens allocationMode typeName membersXObjs =
116116 StackAlloc -> " $p instance;"
117117 HeapAlloc -> " $p *instance = CARP_MALLOC(sizeof(" ++ typeName ++ " ));" ,
118118 assignments pairs,
119- " return * instance;" ,
119+ " return instance;" ,
120120 " }"
121121 ]
122122 where
@@ -125,8 +125,8 @@ productInitTokens allocationMode typeName membersXObjs =
125125 go [] = " "
126126 go xobjs = joinLines $ assign allocationMode <$> xobjs
127127 assign _ (name, (RecTy _)) =
128- " instance" ++ " -> " ++ name ++ " = " ++ " CARP_MALLOC(sizeof(" ++ typeName ++ " ));\n "
129- ++ " *instance-> " ++ name ++ " = " ++ name ++ " ;\n "
128+ " instance" ++ " . " ++ name ++ " = " ++ " CARP_MALLOC(sizeof(" ++ typeName ++ " ));\n "
129+ ++ " *instance. " ++ name ++ " = " ++ name ++ " ;\n "
130130 -- ++ " instance" ++ "->" ++ name ++ " = " ++ "&" ++ name ++ ";\n"
131131 -- ++ " " ++ typeName ++"_delete(" ++ name ++ ");"
132132 assign alloc (name, _) =
You can’t perform that action at this time.
0 commit comments