Skip to content

Commit

Permalink
Merge branch 'main' into rb/diff-informed
Browse files Browse the repository at this point in the history
  • Loading branch information
asgerf authored Dec 20, 2024
2 parents c9d17cc + d5571c5 commit 0e100af
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cpp/ql/src/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### Minor Analysis Improvements

* The "Call to function with fewer arguments than declared parameters" query (`cpp/too-few-arguments`) query no longer produces results if the function has been implicitly declared.
* The "Call to function with fewer arguments than declared parameters" query (`cpp/too-few-arguments`) no longer produces results if the function has been implicitly declared.

## 1.2.7

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ class ReturnStackAllocatedMemoryConfig extends MustFlowConfiguration {
or
node2.(PointerOffsetInstruction).getLeftOperand() = node1
}

override predicate isBarrier(Instruction n) { n.getResultType() instanceof ErroneousType }
}

from
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The "Returning stack-allocated memory" query (`cpp/return-stack-allocated-memory`) no longer produces results if there is an extraction error in the returned expression.
2 changes: 1 addition & 1 deletion cpp/ql/src/change-notes/released/1.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

### Minor Analysis Improvements

* The "Call to function with fewer arguments than declared parameters" query (`cpp/too-few-arguments`) query no longer produces results if the function has been implicitly declared.
* The "Call to function with fewer arguments than declared parameters" query (`cpp/too-few-arguments`) no longer produces results if the function has been implicitly declared.
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,5 @@ char* test_strdupa(const char* s) {
void* test_strndupa(const char* s, size_t size) {
char* s2 = strndupa(s, size);
return s2; // BAD
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// semmle-extractor-options: --expect_errors

UNKNOWN_TYPE test_error_value() {
UNKNOWN_TYPE x;
return x; // GOOD: Error return type
}

void* test_error_pointer() {
UNKNOWN_TYPE x;
return &x; // BAD [FALSE NEGATIVE]
}

int* test_error_pointer_member() {
UNKNOWN_TYPE x;
return &x.y; // BAD [FALSE NEGATIVE]
}

0 comments on commit 0e100af

Please sign in to comment.