Skip to content

Commit 971616f

Browse files
committed
Fixed incorrect handling of Spin2 ^x parameters
1 parent 77ce306 commit 971616f

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Version 7.3.1
22
- Fixed some errors in C __pasm parsing
33
- Fixed compile time calculations of QLOG and QEXP (thanks to Ada)
4+
- Fixed many incorrect address calculations for Spin2 ^x variables
45

56
Version 7.3.0
67
- Allow `__attribute__((packed))` on C structs

frontends/spin/spinlang.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,9 @@ TransformLongMove(AST **astptr, AST *ast)
213213

214214
//
215215
// fix up any parameters passed by reference
216-
// this applies both to calls into BASIC/C++ functions, but
217-
// also ^Struct parameters in Spin2
216+
// this applies both to calls into BASIC/C++ functions
217+
// but not to ^Struct parameters, which are more like
218+
// pointer types
218219
//
219220
static void
220221
FixupSpinParameterTypes(AST **astptr, AST *ast)

frontends/types.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,8 @@ AST *CoerceAssignTypes(AST *line, int kind, AST **astptr, AST *desttype, AST *sr
13241324
}
13251325
}
13261326
AstReportAs(expr, &saveinfo);
1327-
if (IsRefType(desttype) && (kind == AST_FUNCCALL || kind == AST_RETURN)) {
1327+
if (IsRefType(desttype) && (kind == AST_FUNCCALL || kind == AST_RETURN)
1328+
&& !IsSpinLang(lang)) {
13281329
// passing or returning reference parameter
13291330
if (!astptr) {
13301331
ERROR(line, "Unable to pass or return multiple function result to reference parameter");

0 commit comments

Comments
 (0)