Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use lamdas in helper functions #36

Open
priyasiddharth opened this issue Nov 17, 2020 · 0 comments
Open

Use lamdas in helper functions #36

priyasiddharth opened this issue Nov 17, 2020 · 0 comments

Comments

@priyasiddharth
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant