Skip to content

Commit

Permalink
fbc: fix #cmdline restart
Browse files Browse the repository at this point in the history
- if cProgram() encountered a #cmdline directive requesting a restart
  then don't call fbMainEnd() - it doesn't make any sense to continue
  code generation if we know we are going to restart anyway
- related to combining command line options on the command line and
  command line options later encountered in #cmdline directives where
  some part of the user source is parsed and therefore code generation
  begins, but needs to abort and restart cleanly without trying to
  further generate code while tring to abort / restart.
- also related to '-z nobuiltins' specified on the command line with
  #cmdline to setting some options also.  This was causing an issue
  where fbc aborted with error instead of restarting the compilation
  due to fbc unable to complete the exit code normally.
  • Loading branch information
jayrm committed Feb 24, 2024
1 parent 7824bb0 commit 4f5e957
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/compiler/fb.bas
Expand Up @@ -1325,11 +1325,14 @@ sub fbCompile _

fbParsePreDefines()
fbParsePreIncludes()

if (fbShouldContinue()) then
cProgram()
end if

fbMainEnd( )
if (fbShouldContinue()) then
fbMainEnd( )
end if

'' compiling only, not cross-compiling?
if( fbGetOption( FB_COMPOPT_OBJINFO ) and _
Expand Down

0 comments on commit 4f5e957

Please sign in to comment.