Skip to content

Not merging inlines breaks fundec invariant #84

@sim642

Description

@sim642

fundec claims the invariant that the physical objects are in one-to-one correspondence with varinfos:

cil/src/cil.ml

Lines 688 to 694 in c47bbbd

(** Function definitions. *)
and fundec =
{ mutable svar: varinfo;
(** Holds the name and type as a variable, so we can refer to it
* easily from the program. All references to this function either
* in a function call or in a prototype must point to the same
* varinfo. *)

And Goblint relies on this invariant by identifying functions by the underlying variable (ID).

In goblint/analyzer#603 (comment), I realized that #72 broke this invariant.
This is also easily seen in the code:

cil/src/mergecil.ml

Lines 1421 to 1425 in c47bbbd

| GFun (fdec, l) as g ->
currentLoc := l;
incr currentDeclIdx;
(* We apply the renaming *)
fdec.svar <- processVarinfo fdec.svar l;

where the underlying variable is replaced unconditionally (of merge_inlines).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions