File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -5539,7 +5539,20 @@ CompileFunctionBody(Function *f)
5539
5539
if (init ) {
5540
5540
AST * zero = AstInteger (0 );
5541
5541
if (IsIdentifier (init ) || init -> kind == AST_RESULT ) {
5542
- AST * resinit = AstAssign (init , zero );
5542
+ AST * typ = ExprType (init );
5543
+ int n = TypeSize (typ );
5544
+ AST * resinit ;
5545
+ if (n <= LONG_SIZE ) {
5546
+ resinit = AstAssign (init , zero );
5547
+ } else {
5548
+ /* do a multiple assignment */
5549
+ AST * initlist = NULL ;
5550
+ n = (n + LONG_SIZE - 1 ) / LONG_SIZE ;
5551
+ for (int i = 0 ; i < n ; i ++ ) {
5552
+ initlist = AddToList (initlist , NewAST (AST_EXPRLIST , zero , NULL ));
5553
+ }
5554
+ resinit = AstAssign (init , initlist );
5555
+ }
5543
5556
CompileStatement (irl , cold_irl_ptr , resinit );
5544
5557
} else if (init -> kind == AST_EXPRLIST ) {
5545
5558
AST * var ;
You can’t perform that action at this time.
0 commit comments