Return statement does not exit function

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Minor
    • Component/s: coverity-plugin
    • None

      Hi,

      I have a boolean function which uses 'withCoverityEnv'. Inside that code block I have an if statement and when it returns false it does not exit the function, it only exits the withCoverityEnv block

      Example

       

      boolean myFunFunction()
      {
         withCoverityEnv(coverityToolName: 'default', 
            connectInstance: 'foo-bar')
      
         {
            if (someBadCondition)
            {
               echo " bad  "
               return false
            }
            SomeMoreCode that is skipped
         }
         someMoreCodeThatGetsExecuted!
         return true
      }

       

      so even when 'someBadCondition' happens

      my code ends up returning true

      since that return false only exits the 'withCoverityEnv' block

            Assignee:
            Synopsys SIG
            Reporter:
            Juan Caldas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: