Skip to content

CBMC does not detect reachable error label before return statement #6304

Closed
@PhilippWendler

Description

@PhilippWendler

When telling CBMC to look for error labels with the argument --error-label ERROR, it ignores labels that are directly before a return statement.

Example: cbmc --error-label ERROR returns "verification successful" for the following program:

int main() {
  goto ERROR;

  return 0;
  ERROR:
//  ;
  return 1;
}

If I add some other statement before the return (even by just removing the //), the result is "verification failed" as expected.

CBMC version: 5.36 (problem is present at least in 5.12 as well)
Operating system: the Docker container diffblue/cbmc:5.36.0
Exact command line resulting in the issue: cbmc --error-label ERROR program.c
What behaviour did you expect: Error label found as reachabled
What happened instead: Reachable error label ignored

Metadata

Metadata

Assignees

No one assigned

    Labels

    awsBugs or features of importance to AWS CBMC usersbugpending merge

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions