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 _) _) [
63
63
instanceBinder
64
64
(SymPath insidePath " init" )
65
65
(FuncTy (initArgListTypes membersXObjs) structTy StaticLifetimeTy )
66
- (recursiveProductInit HeapAlloc structTy membersXObjs)
66
+ (recursiveProductInit StackAlloc structTy membersXObjs)
67
67
(" creates a `" ++ show structTy ++ " `." )
68
68
where initArgListTypes :: [XObj ] -> [Ty ]
69
69
initArgListTypes xobjs =
@@ -116,7 +116,7 @@ productInitTokens allocationMode typeName membersXObjs =
116
116
StackAlloc -> " $p instance;"
117
117
HeapAlloc -> " $p *instance = CARP_MALLOC(sizeof(" ++ typeName ++ " ));" ,
118
118
assignments pairs,
119
- " return * instance;" ,
119
+ " return instance;" ,
120
120
" }"
121
121
]
122
122
where
@@ -125,8 +125,8 @@ productInitTokens allocationMode typeName membersXObjs =
125
125
go [] = " "
126
126
go xobjs = joinLines $ assign allocationMode <$> xobjs
127
127
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 "
130
130
-- ++ " instance" ++ "->" ++ name ++ " = " ++ "&" ++ name ++ ";\n"
131
131
-- ++ " " ++ typeName ++"_delete(" ++ name ++ ");"
132
132
assign alloc (name, _) =
You can’t perform that action at this time.
0 commit comments