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

[CN-Exec] Source injection error for single-line if statements with local variables #714

Open
ZippeyKeys12 opened this issue Nov 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working CN spec testing cn CN-exec Related to CN executable spec generation, called using `cn instrument`

Comments

@ZippeyKeys12
Copy link
Collaborator

void f()
{
    int found = 10;

    if (!found) return;
}

int main() {
    f();

    return 0;
}

Instrumentation of the if looks like:

if (!CN_LOAD(found)) 
  c_remove_from_ghost_state((uintptr_t) &found, sizeof(signed int));
  goto __cn_epilogue;

It should be:

if (!CN_LOAD(found)) {
  c_remove_from_ghost_state((uintptr_t) &found, sizeof(signed int));
  goto __cn_epilogue;
}
@rbanerjee20
Copy link
Contributor

Thanks for flagging this @ZippeyKeys12 - currently the existing and ideal instrumentation code snippets look identical. If you could update them whenever you get the chance (probably not urgent), that would be great.

@ZippeyKeys12
Copy link
Collaborator Author

The existing snippet is missing braces

@ZippeyKeys12 ZippeyKeys12 added the bug Something isn't working label Nov 26, 2024
@rbanerjee20 rbanerjee20 added the CN-exec Related to CN executable spec generation, called using `cn instrument` label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CN spec testing cn CN-exec Related to CN executable spec generation, called using `cn instrument`
Projects
None yet
Development

No branches or pull requests

2 participants