-
Notifications
You must be signed in to change notification settings - Fork 142
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
Swift Taint Tests #592
base: development
Are you sure you want to change the base?
Swift Taint Tests #592
Conversation
…exception as intended
@fabianbs96 I just changed the Taint Analysis' handling of the Store instruction to reuse our workaround from the LCA.
The analysis now reports the following leak. I would actually expect it to report %0, however %_value2 does make sense if I look at the IR, what do you think?
|
Hi @janniclas, thanks for pointing this out. You are right, the store should actually habe handled by the alias information. However, it seems that we are only generating aliases when calling a source-function with output-parameters and considering them for creating leak-sets. This should probably be fixed in the future; for now, your workaround makes sense. Regarding the leak-reporting: We have that lines Btw. I enabled compiling the swift tests on my system and it seems for them the incremental build does not work properly, i.e. every time when I rebuild phasar (incrementally) it rebuilds all swift tests. Can you fix it? |
…th every build call
I extended this PR with fixes to finally support PhASAR on Macs with the new Apple Silicon. |
README.md
Outdated
export LDFLAGS="-L/opt/homebrew/opt/llvm@14/lib" | ||
export CPPFLAGS="-I/opt/homebrew/opt/llvm@14/include" | ||
export PATH="/opt/homebrew/opt/llvm@14/bin:$PATH" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these flags have to be env variables? Or can they also be supplied to cmake directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we could do is define it as a default variable in cmake and users could change it with a cmake flag like
-DPathToLLVM=/my/custom/llvm/install/llvm@14
I think this could make sense.
@@ -2,7 +2,7 @@ | |||
/// a workaround here | |||
|
|||
#ifndef HAS_MEMORY_RESOURCE | |||
#if !defined(__has_include) || __has_include(<memory_resource>) | |||
#if !defined(__has_include) || __has_include(<memory_resource>) && !defined(__APPLE__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add a comment to describe why we exclude pmr on apple.
Btw, are the feature-test macros __cpp_lib_memory_resource
and __cpp_lib_polymorphic_allocator
defined on apple?
return generateFlow(Extract, Extract->getAggregateOperand()); | ||
} | ||
|
||
if (const auto *Insert = llvm::dyn_cast<llvm::InsertValueInst>(Curr)) { | ||
return generateFlow(Insert, Insert->getInsertedValueOperand()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also generate insert from Insert->getAggregateOperand()
This PR contains a first set of Swift tests for the IFDS Taint Analysis.
Also code style changes were applied to existing Swift tests.
We currently can't correctly handle the CommandLine arguments and exceptions and the corresponding tests are therefore disabled.
To fix the exception handling we most likely need to update the handling of the load instruction similarly to the workaround we implemented for the LCA.
Code pattern causing the problem:
This will be addressed in a later PR.