Skip to content

Commit

Permalink
fbc: remove assert in symbTypeToStr()
Browse files Browse the repository at this point in the history
- pointer count for the function type could be zero if we are dumping from an AST
- should never see this for fbc declared types in user code
- therefore allow a pointer count of zero without waiting an assert
  • Loading branch information
jayrm committed Dec 26, 2020
1 parent c9edeb4 commit 8527a57
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/compiler/symb.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1714,9 +1714,12 @@ function symbTypeToStr _
case FB_DATATYPE_FUNCTION
'' Procedure pointer

'' The sub() or function() already implies one PTR
assert( ptrcount > 0 )
ptrcount -= 1
'' The sub() or function() already implies one PTR, unless
'' we are dumping this from AST in which case the SYM could
'' refer the the procedure type itself with no pointer.
if( ptrcount > 0 ) then
ptrcount -= 1
end if

'' If there are any more PTRs, i.e. a PTR to a proc PTR,
'' then it must be emitted inside a typeof():
Expand Down

0 comments on commit 8527a57

Please sign in to comment.