goblint / goblint/analyzer

`location_invariant` should not be at `switch` `case` label

Open
#1,925 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

sv-comp
Dominant language
OCaml
Stars
252
Forks
90
Avg merge
4d 1m
Merged PRs (30d)
19

Description

As discovered by @jprotopopov-ut, Goblint can output location_invariant at a switch case label.
This is not allowed by the YAML witness format: it's not be first character of a statement.

Also, inserting an assertion there would not mean the right thing: the assertion would be the last thing in the previous case.
Internally, these probably come from internal if branching nodes from a CIL-converted switch.
Not sure if we have enough information available in Goblint to distinguish the original source of the branchings.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Goblint emits location_invariant for internal if-branching nodes created by CIL-converted switch statements. Check whether the available information distinguishes the original switch source and prevents output at case labels. Done means the YAML witness is valid and any inserted assertion refers to the correct statement rather than the previous case.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, ocaml, yaml
Domain
compilers, devtools
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.