[WIP] Reworking implementation of operation masking sanitizer#236
[WIP] Reworking implementation of operation masking sanitizer#236elazaro-riverside wants to merge 11 commits into
Conversation
…to add a testcase for this sanitizer.
…ion to masked operation.
ec6295a to
5abd364
Compare
|
The current operation masking sanitizer creates wrappers that return the first argument as a stub for the original operation. The problem is that the compiler instrumentation replaces all uses with the stub meaning that arguments that are "normal" are replaced as well. The new approach will focus on transforming the wrappers from stubs into compiler-generated contract enforcement. The key idea is that the compiler won't know about the operation specifically (ex. |
|
One of the challenges is generating the correct preconditions for the corresponding predicate. |
|
I want to introduce this new abstraction in RESOLVE to represent predicates and contracts. enum class PredicateKind {
InBounds,
NotEqual,
NotNull,
Nonzero,
};
// Predicates tell the compiler what
// must be true before executing
// operation
struct Predicate {
PredicateKind kind;
unsigned arg0;
unsigned arg1;
};
struct Contract {
std::string fnName;
std::vector<Predicate> predicates;
}; |
…ted handler prefix to better reflect purpose.
…ly-typed and scoped.
Fill this PR in when ready.