Skip to content

Commit

Permalink
Dim Byref: Fix NULL access during cVarDecl() error recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
dkl committed May 14, 2015
1 parent b320c3c commit 0467580
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/compiler/parser-decl-var.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1631,14 +1631,15 @@ function cVarDecl _
end if
end if
else
if( symbIsRef( sym ) ) then
errReport( FB_ERRMSG_MISSINGREFINIT )
hSkipStmt( )
exit function
end if

'' default initialization
if( sym ) then
'' Byref? Always requires an explicit initializer
if( symbIsRef( sym ) ) then
errReport( FB_ERRMSG_MISSINGREFINIT )
hSkipStmt( )
exit function
end if

if( symbArrayHasUnknownBounds( sym ) ) then
errReport( FB_ERRMSG_MUSTHAVEINITWITHELLIPSIS )
hSkipStmt( )
Expand Down

0 comments on commit 0467580

Please sign in to comment.