Skip to content

Commit

Permalink
Spin2 method pointers default to void
Browse files Browse the repository at this point in the history
  • Loading branch information
totalspectrum committed Oct 22, 2023
1 parent ac374bf commit 49c4efa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3595,6 +3595,14 @@ FuncNumResults(AST *functype)
functype = functype->left;
}
if (!IsFunctionType(functype)) {
// if this is Spin2, assume it is a void type (there would be
// an explicit :1 after it otherwise)
if (GetCurrentLang() == LANG_SPIN_SPIN2) {
return 0;
}
// otherwise punt and assume just 1 return type; this works for
// many Spin1 functions, and C and BASIC should have proper function
// types anyway
return 1; // unknown return type
}
functype = functype->left;
Expand Down

0 comments on commit 49c4efa

Please sign in to comment.