Skip to content

Commit 06cdc3f

Browse files
committed
fixed assignment to members of structure return values
1 parent ac1e792 commit 06cdc3f

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Version 7.6.5
2+
- Fixed assignment to members of a structure return value
3+
14
Version 7.6.4
25
- Added QEXP and QLOG implementations for P1
36
- Allow upper case #pragma names

backends/asm/outasm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// Pasm data output for spin2cpp
33
//
4-
// Copyright 2016-2025 Total Spectrum Software Inc.
4+
// Copyright 2016-2026 Total Spectrum Software Inc. and contributors
55
// see the file COPYING for conditions of redistribution
66
//
77
#include <stdio.h>
@@ -286,7 +286,7 @@ PutVarOnStack(Function *func, Symbol *sym, int size)
286286
if (!ANY_VARS_ON_STACK(func)) {
287287
return false;
288288
}
289-
if (sym->kind == SYM_LOCALVAR && TypeGoesOnStack((AST *)sym->v.ptr)) {
289+
if ( (sym->kind == SYM_LOCALVAR || sym->kind == SYM_RESULT) && TypeGoesOnStack((AST *)sym->v.ptr)) {
290290
return true;
291291
}
292292
if (sym->flags & SYMF_ADDRESSABLE) {
@@ -4643,7 +4643,7 @@ CompileExpression(IRList *irl, AST *expr, Operand *dest)
46434643
}
46444644
}
46454645
finaltype = ExprType(expr);
4646-
if (off == 0 && IsCogMem(base)) {
4646+
if (off == 0 && IsCogMem(base) && TypeSize(finaltype) >= LONG_SIZE) {
46474647
r = base;
46484648
} else {
46494649
r = OffsetMemory(irl, base, NewImmediate(off), finaltype, expr);

frontends/spin/spinlang.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,8 @@ doSpinTransform(AST **astptr, int level, AST *parent)
928928
AstReportDone(&saveinfo);
929929
*ast = *deref;
930930
break;
931-
}
931+
}
932+
case SYM_RESULT:
932933
case SYM_LOCALVAR:
933934
case SYM_PARAMETER:
934935
isLocal = 1;

version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
#define VERSION_MAJOR 7
88
#define VERSION_MINOR 6
9-
#define VERSION_REV 4
10-
//#define BETA "-beta"
9+
#define VERSION_REV 5
10+
#define BETA "-beta"
1111

1212
#define VERSIONSTR version_string
1313

0 commit comments

Comments
 (0)