Skip to content

Commit 5cb3b02

Browse files
committed
Fix a spurious error about types with pending variables used as function return values
1 parent 747b9a1 commit 5cb3b02

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Version 6.1.8
22
- Fixed multiple uses of LET in BASIC programs
3+
- Made sure class types are resolved when they are used as function returns
34
- Made UTF-8 the default encoding for FatFS (configurable via FF_LFN_UNICODE)
45

56
Version 6.1.7

functions.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,8 @@ doDeclareFunction(AST *funcblock)
10571057
ERROR(funcdef, "Bad function declaration for %s", fdef->name);
10581058
fdef->overalltype->left = ast_type_generic;
10591059
}
1060-
siz = TypeSize(fdef->overalltype->left);
1060+
// if the type has pending variables, resolve them
1061+
siz = CheckedTypeSize(fdef->overalltype->left);
10611062
if (TypeGoesOnStack(fdef->overalltype->left)) {
10621063
fdef->numresults = 1; // will return a pointer
10631064
} else {

0 commit comments

Comments
 (0)