Skip to content

Instantly share code, notes, and snippets.

@agustingianni
Created June 30, 2020 22:03
Show Gist options
  • Save agustingianni/b719594a4b7dd359d23fc07b394cfe97 to your computer and use it in GitHub Desktop.
Save agustingianni/b719594a4b7dd359d23fc07b394cfe97 to your computer and use it in GitHub Desktop.
from FunctionCall call, FunctionCall lock
where
// Assert that `lock` is your lock function.
lock.getTarget().getName() = "lock_function" and
// Assert that `call` is your target function.
call.getTarget().getName() = "yrp" and
// Assert that there is not a predecesor to `call` that is a call to the lock function.
not call.getAPredecessor+() = lock
select call, "Function is called without locking"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment