File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
src/Likely Bugs/Memory Management
test/query-tests/Likely Bugs/Memory Management/ReturnStackAllocatedMemory Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ class ReturnStackAllocatedMemoryConfig extends MustFlowConfiguration {
92
92
or
93
93
node2 .( PointerOffsetInstruction ) .getLeftOperand ( ) = node1
94
94
}
95
+
96
+ override predicate isBarrier ( Instruction n ) { n .getResultType ( ) instanceof ErroneousType }
95
97
}
96
98
97
99
from
Original file line number Diff line number Diff line change 1
- // semmle-extractor-options: -std=c++14
1
+ // semmle-extractor-options: -std=c++14 --expect_errors
2
2
class MyClass
3
3
{
4
4
public:
@@ -248,4 +248,9 @@ char* test_strdupa(const char* s) {
248
248
void * test_strndupa (const char * s, size_t size) {
249
249
char * s2 = strndupa (s, size);
250
250
return s2; // BAD
251
- }
251
+ }
252
+
253
+ UNKNOWN_TYPE test_error_type () {
254
+ UNKNOWN_TYPE x;
255
+ return x; // GOOD: Don't report error types
256
+ }
You can’t perform that action at this time.
0 commit comments