[JIRA] (JENKINS-61086) Return statement does not exit function

0 views
Skip to first unread message

Juan.D.Caldas@Raytheon.com (JIRA)

unread,
Feb 13, 2020, 1:55:02 PM2/13/20
to jenkinsc...@googlegroups.com
Juan Caldas created an issue
 
Jenkins / Bug JENKINS-61086
Return statement does not exit function
Issue Type: Bug Bug
Assignee: Synopsys SIG
Components: coverity-plugin
Created: 2020-02-13 18:54
Priority: Minor Minor
Reporter: Juan Caldas

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

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages