Skip to content

Commit 8a965ca

Browse files
committed
fixed incorrect array casts
1 parent 411ec8f commit 8a965ca

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Version 7.0.1
2+
- Fixed incorrect casts of arrays
3+
14
Version 7.0.0
25
- Added Spin2 structures (basically small objects)
36
- Added Spin2 TASK functions

frontends/hltransform.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,9 @@ doSimplifyAssignments(AST **astptr, int insertCasts, int atTopLevel)
372372
AST *typ = ExprType(ast);
373373
if (typ && TypeSize(typ) > LONG_SIZE) {
374374
AstReportAs(ast, &saveinfo);
375+
if (IsArrayType(typ)) {
376+
typ = ArrayToPointerType(typ);
377+
}
375378
AST *cond = ast->left;
376379
AST *ifcond = ast->right->left;
377380
AST *elsecond = ast->right->right;
@@ -382,7 +385,7 @@ doSimplifyAssignments(AST **astptr, int insertCasts, int atTopLevel)
382385
AstTypedAssignStmt(tempvar, ifcond, typ),
383386
AstTypedAssignStmt(tempvar, elsecond, typ)));
384387

385-
AST *stmt = NewAST(AST_SEQUENCE,
388+
AST *stmt = NewAST(AST_STMTLIST,
386389
newif,
387390
tempvar);
388391
*astptr = ast = stmt;

0 commit comments

Comments
 (0)