Skip to content

Commit 49c4efa

Browse files
committed
Spin2 method pointers default to void
1 parent ac374bf commit 49c4efa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

expr.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3595,6 +3595,14 @@ FuncNumResults(AST *functype)
35953595
functype = functype->left;
35963596
}
35973597
if (!IsFunctionType(functype)) {
3598+
// if this is Spin2, assume it is a void type (there would be
3599+
// an explicit :1 after it otherwise)
3600+
if (GetCurrentLang() == LANG_SPIN_SPIN2) {
3601+
return 0;
3602+
}
3603+
// otherwise punt and assume just 1 return type; this works for
3604+
// many Spin1 functions, and C and BASIC should have proper function
3605+
// types anyway
35983606
return 1; // unknown return type
35993607
}
36003608
functype = functype->left;

0 commit comments

Comments
 (0)