Merge branch 'mathiasvp/replace-ast-with-ir-use-usedataflow' into no-taint-indirect-direct-conflation

This commit is contained in:
Mathias Vorreiter Pedersen
2023-02-27 17:19:36 +00:00
4 changed files with 9 additions and 21 deletions

View File

@@ -457,7 +457,7 @@ class PostFieldUpdateNode extends TPostFieldUpdateNode, PartialDefinitionNode {
PostFieldUpdateNode() { this = TPostFieldUpdateNode(fieldAddress, indirectionIndex) }
override Function getFunction() { result = fieldAddress.getUse().getEnclosingFunction() }
override Declaration getFunction() { result = fieldAddress.getUse().getEnclosingFunction() }
override Declaration getEnclosingCallable() { result = this.getFunction() }
@@ -539,7 +539,7 @@ class SideEffectOperandNode extends Node, IndirectOperand {
override Declaration getEnclosingCallable() { result = this.getFunction() }
override Function getFunction() { result = call.getEnclosingFunction() }
override Declaration getFunction() { result = call.getEnclosingFunction() }
Expr getArgument() { result = call.getArgument(argumentIndex).getUnconvertedResultExpression() }
}
@@ -625,7 +625,7 @@ class IndirectParameterNode extends Node, IndirectInstruction {
override Declaration getEnclosingCallable() { result = this.getFunction() }
override Function getFunction() { result = this.getInstruction().getEnclosingFunction() }
override Declaration getFunction() { result = this.getInstruction().getEnclosingFunction() }
override string toStringImpl() {
result = this.getParameter().toString() + " indirection"
@@ -698,7 +698,7 @@ class IndirectArgumentOutNode extends Node, TIndirectArgumentOutNode, PartialDef
override Declaration getEnclosingCallable() { result = this.getFunction() }
override Function getFunction() { result = this.getCallInstruction().getEnclosingFunction() }
override Declaration getFunction() { result = this.getCallInstruction().getEnclosingFunction() }
override Node getPreUpdateNode() { hasOperandAndIndex(result, operand, indirectionIndex) }
@@ -861,7 +861,7 @@ class RawIndirectOperand extends Node, TRawIndirectOperand {
/** Gets the underlying indirection index. */
int getIndirectionIndex() { result = indirectionIndex }
override Function getFunction() { result = this.getOperand().getDef().getEnclosingFunction() }
override Declaration getFunction() { result = this.getOperand().getDef().getEnclosingFunction() }
override Declaration getEnclosingCallable() { result = this.getFunction() }
@@ -902,7 +902,7 @@ class FinalParameterNode extends Node, TFinalParameterNode {
/** Gets the argument index associated with this final use. */
final int getArgumentIndex() { result = p.getIndex() }
override Function getFunction() { result = p.getFunction() }
override Declaration getFunction() { result = p.getFunction() }
override Declaration getEnclosingCallable() { result = this.getFunction() }
@@ -959,7 +959,7 @@ class RawIndirectInstruction extends Node, TRawIndirectInstruction {
/** Gets the underlying indirection index. */
int getIndirectionIndex() { result = indirectionIndex }
override Function getFunction() { result = this.getInstruction().getEnclosingFunction() }
override Declaration getFunction() { result = this.getInstruction().getEnclosingFunction() }
override Declaration getEnclosingCallable() { result = this.getFunction() }

View File

@@ -1,8 +1,4 @@
uniqueEnclosingCallable
| globals.cpp:9:5:9:19 | flowTestGlobal1 indirection | Node should have one enclosing callable but has 0. |
| globals.cpp:9:5:9:19 | flowTestGlobal1 indirection | Node should have one enclosing callable but has 0. |
| globals.cpp:16:12:16:26 | flowTestGlobal2 indirection | Node should have one enclosing callable but has 0. |
| globals.cpp:16:12:16:26 | flowTestGlobal2 indirection | Node should have one enclosing callable but has 0. |
uniqueType
uniqueNodeLocation
missingLocation

View File

@@ -1,12 +1,4 @@
uniqueEnclosingCallable
| cpp11.cpp:36:5:36:14 | global_int indirection | Node should have one enclosing callable but has 0. |
| cpp11.cpp:36:5:36:14 | global_int indirection | Node should have one enclosing callable but has 0. |
| misc.c:10:5:10:13 | topLevel1 indirection | Node should have one enclosing callable but has 0. |
| misc.c:10:5:10:13 | topLevel1 indirection | Node should have one enclosing callable but has 0. |
| misc.c:11:5:11:13 | topLevel2 indirection | Node should have one enclosing callable but has 0. |
| misc.c:11:5:11:13 | topLevel2 indirection | Node should have one enclosing callable but has 0. |
| misc.c:210:5:210:20 | global_with_init indirection | Node should have one enclosing callable but has 0. |
| misc.c:210:5:210:20 | global_with_init indirection | Node should have one enclosing callable but has 0. |
uniqueType
uniqueNodeLocation
| allocators.cpp:14:5:14:8 | Phi | Node should have one location but has 4. |

View File

@@ -35,7 +35,7 @@ void test3_2(InputSource &data) {
SAX2XMLReader *p_3_3 = XMLReaderFactory::createXMLReader();
void test3_3(InputSource &data) {
p_3_3->parse(data); // BAD (parser not correctly configured) [NOT DETECTED]
p_3_3->parse(data); // BAD (parser not correctly configured)
}
SAX2XMLReader *p_3_4 = XMLReaderFactory::createXMLReader();
@@ -53,7 +53,7 @@ void test3_5_init() {
void test3_5(InputSource &data) {
test3_5_init();
p_3_5->parse(data); // GOOD
p_3_5->parse(data); // GOOD [FALSE POSITIVE]
}
void test3_6(InputSource &data) {