Skip to content

Use lamdas in helper functions #36

Open
@priyasiddharth

Description

@priyasiddharth

context: f0a72b3#r44268019

I tried various things

  1. use boost::hana anonymous/lambda functions
  2. use c++14 lambda functions

The generated bitcode seems correct but is not correctly processed by our pipeline. Some issues I see are

  1. Some hana idioms generate a lot of code e.g. while_, but some don't e.g. times_with_index
  2. in some cases the generated functions in bitcode don't follow C naming and hence are not found by BMC engine
  3. even if they are found, they have some trouble accessing values in the creation context. Specifically
[&](auto i) {
  if (str[i] == '\0' and !found) {
    sassert(0);  \\ never fires
    length = i
    found = true
  }
}

Figuring why 3 was happening seemed out of scope to me so I went with a basic solution that did not rely on these features.

from @agurfinkel
ok. something to revisit during the break. Remind me. I can dig into bitcode to look what is going on.
SeaHorn works on C++ code. The C naming convention should not be related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions