Skip to content

Commit 26a11ef

Browse files
authored
Merge branch 'main' into js/test-suite
2 parents 1964b34 + 498bfd2 commit 26a11ef

File tree

9 files changed

+201
-158
lines changed

9 files changed

+201
-158
lines changed

cpp/ql/lib/DefaultOptions.qll

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ class Options extends string {
5454
*
5555
* By default, this holds for `exit`, `_exit`, `_Exit`, `abort`,
5656
* `__assert_fail`, `longjmp`, `__builtin_unreachable` and any
57-
* function with a `noreturn` or `__noreturn__` attribute or
58-
* `noreturn` specifier.
57+
* function with a `noreturn`, `__noreturn__`, or `_Noreturn`
58+
* attribute or `noreturn` specifier.
5959
*/
6060
predicate exits(Function f) {
61-
f.getAnAttribute().hasName(["noreturn", "__noreturn__"])
61+
f.getAnAttribute().hasName(["noreturn", "__noreturn__", "_Noreturn"])
6262
or
6363
f.getASpecifier().hasName("noreturn")
6464
or
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* `DefaultOptions::exits` now holds for C23 functions with the `_Noreturn` or `___Noreturn__` attribute.

cpp/ql/src/Architecture/Refactoring Opportunities/ClassesWithManyFields.ql

+1-6
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,7 @@ where
168168
strictcount(string fieldName |
169169
exists(Field f |
170170
f.getDeclaringType() = c and
171-
fieldName = f.getName() and
172-
// IBOutlet's are a way of building GUIs
173-
// automatically out of ObjC properties.
174-
// We don't want to count those for the
175-
// purposes of this query.
176-
not f.getType().getAnAttribute().hasName("iboutlet")
171+
fieldName = f.getName()
177172
)
178173
) and
179174
n > 15 and

cpp/ql/test/query-tests/jsf/4.13 Functions/AV Rule 114/test.c

+25-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// semmle-extractor-options: -std=c11
1+
// semmle-extractor-options: -std=c23
22
int f1(void) {
33
int x = 1;
44
return 2;
@@ -110,3 +110,27 @@ int f17() {
110110
if (__builtin_expect(1, 0))
111111
__builtin_unreachable(); // GOOD
112112
}
113+
114+
[[_Noreturn]] void f18();
115+
116+
int f19() {
117+
f18(); // GOOD
118+
}
119+
120+
[[___Noreturn__]] void f20();
121+
122+
int f21() {
123+
f20(); // GOOD
124+
}
125+
126+
[[noreturn]] void f22();
127+
128+
int f23() {
129+
f22(); // GOOD
130+
}
131+
132+
[[__noreturn__]] void f24();
133+
134+
int f25() {
135+
f24(); // GOOD
136+
}

cpp/ql/test/query-tests/jsf/4.13 Functions/AV Rule 114/test.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,10 @@ int g22() {
188188
int g23() {
189189
Aborting().a(); // GOOD [FALSE POSITIVE]
190190
}
191+
192+
[[__noreturn__]]
193+
int g24();
194+
195+
int g25() {
196+
g24(); // GOOD
197+
}

go/documentation/library-coverage/coverage.csv

+142-142
Large diffs are not rendered by default.

go/documentation/library-coverage/coverage.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ Go framework & library support
2626
`Macaron <https://gopkg.in/macaron.v1>`_,``gopkg.in/macaron*``,12,1,1
2727
`Revel <http://revel.github.io/>`_,"``github.com/revel/revel*``, ``github.com/robfig/revel*``",46,20,4
2828
`SendGrid <https://github.com/sendgrid/sendgrid-go>`_,``github.com/sendgrid/sendgrid-go*``,,1,
29-
`Standard library <https://pkg.go.dev/std>`_,"````, ``archive/*``, ``bufio``, ``bytes``, ``cmp``, ``compress/*``, ``container/*``, ``context``, ``crypto``, ``crypto/*``, ``database/*``, ``debug/*``, ``embed``, ``encoding``, ``encoding/*``, ``errors``, ``expvar``, ``flag``, ``fmt``, ``go/*``, ``hash``, ``hash/*``, ``html``, ``html/*``, ``image``, ``image/*``, ``index/*``, ``io``, ``io/*``, ``log``, ``log/*``, ``maps``, ``math``, ``math/*``, ``mime``, ``mime/*``, ``net``, ``net/*``, ``os``, ``os/*``, ``path``, ``path/*``, ``plugin``, ``reflect``, ``reflect/*``, ``regexp``, ``regexp/*``, ``slices``, ``sort``, ``strconv``, ``strings``, ``sync``, ``sync/*``, ``syscall``, ``syscall/*``, ``testing``, ``testing/*``, ``text/*``, ``time``, ``time/*``, ``unicode``, ``unicode/*``, ``unsafe``",34,604,104
29+
`Standard library <https://pkg.go.dev/std>`_,"````, ``archive/*``, ``bufio``, ``bytes``, ``cmp``, ``compress/*``, ``container/*``, ``context``, ``crypto``, ``crypto/*``, ``database/*``, ``debug/*``, ``embed``, ``encoding``, ``encoding/*``, ``errors``, ``expvar``, ``flag``, ``fmt``, ``go/*``, ``hash``, ``hash/*``, ``html``, ``html/*``, ``image``, ``image/*``, ``index/*``, ``io``, ``io/*``, ``log``, ``log/*``, ``maps``, ``math``, ``math/*``, ``mime``, ``mime/*``, ``net``, ``net/*``, ``os``, ``os/*``, ``path``, ``path/*``, ``plugin``, ``reflect``, ``reflect/*``, ``regexp``, ``regexp/*``, ``slices``, ``sort``, ``strconv``, ``strings``, ``sync``, ``sync/*``, ``syscall``, ``syscall/*``, ``testing``, ``testing/*``, ``text/*``, ``time``, ``time/*``, ``unicode``, ``unicode/*``, ``unsafe``",52,605,104
3030
`XPath <https://github.com/antchfx/xpath>`_,``github.com/antchfx/xpath*``,,,4
3131
`appleboy/gin-jwt <https://github.com/appleboy/gin-jwt>`_,``github.com/appleboy/gin-jwt*``,,,1
32-
`beego <https://beego.me/>`_,"``github.com/astaxie/beego*``, ``github.com/beego/beego*``",63,63,213
32+
`beego <https://beego.me/>`_,"``github.com/astaxie/beego*``, ``github.com/beego/beego*``",102,63,213
3333
`chi <https://go-chi.io/>`_,``github.com/go-chi/chi*``,3,,
3434
`cristalhq/jwt <https://github.com/cristalhq/jwt>`_,``github.com/cristalhq/jwt*``,,,1
3535
`fasthttp <https://github.com/valyala/fasthttp>`_,``github.com/valyala/fasthttp*``,50,5,35
@@ -60,6 +60,6 @@ Go framework & library support
6060
`xpathparser <https://github.com/santhosh-tekuri/xpathparser>`_,``github.com/santhosh-tekuri/xpathparser*``,,,2
6161
`yaml <https://gopkg.in/yaml.v3>`_,``gopkg.in/yaml*``,,9,
6262
`zap <https://go.uber.org/zap>`_,``go.uber.org/zap*``,,11,33
63-
Others,"``github.com/Masterminds/squirrel``, ``github.com/caarlos0/env``, ``github.com/go-gorm/gorm``, ``github.com/go-xorm/xorm``, ``github.com/gobuffalo/envy``, ``github.com/gogf/gf/database/gdb``, ``github.com/hashicorp/go-envparse``, ``github.com/jinzhu/gorm``, ``github.com/jmoiron/sqlx``, ``github.com/joho/godotenv``, ``github.com/kelseyhightower/envconfig``, ``github.com/lann/squirrel``, ``github.com/raindog308/gorqlite``, ``github.com/rqlite/gorqlite``, ``github.com/uptrace/bun``, ``go.mongodb.org/mongo-driver/mongo``, ``gopkg.in/Masterminds/squirrel``, ``gorm.io/gorm``, ``xorm.io/xorm``",23,2,391
64-
Totals,,308,928,1532
63+
Others,"``github.com/Masterminds/squirrel``, ``github.com/caarlos0/env``, ``github.com/go-gorm/gorm``, ``github.com/go-xorm/xorm``, ``github.com/gobuffalo/envy``, ``github.com/gogf/gf/database/gdb``, ``github.com/hashicorp/go-envparse``, ``github.com/jinzhu/gorm``, ``github.com/jmoiron/sqlx``, ``github.com/joho/godotenv``, ``github.com/kelseyhightower/envconfig``, ``github.com/lann/squirrel``, ``github.com/raindog308/gorqlite``, ``github.com/rqlite/gorqlite``, ``github.com/uptrace/bun``, ``go.mongodb.org/mongo-driver/mongo``, ``gopkg.in/Masterminds/squirrel``, ``gorm.io/gorm``, ``xorm.io/xorm``",117,16,391
64+
Totals,,459,943,1532
6565

javascript/ql/lib/semmle/javascript/dataflow/internal/FlowSummaryPrivate.qll

+12
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ private import semmle.javascript.internal.flow_summaries.ExceptionFlow
1616
*/
1717
class SummarizedCallableBase = string;
1818

19+
class SourceBase extends Unit {
20+
SourceBase() { none() }
21+
}
22+
23+
class SinkBase extends Unit {
24+
SinkBase() { none() }
25+
}
26+
1927
/** Gets the parameter position representing a callback itself, if any. */
2028
ArgumentPosition callbackSelfParameterPosition() { result.isFunctionSelfReference() }
2129

@@ -139,6 +147,10 @@ private module FlowSummaryStepInput implements Private::StepsInputSig {
139147
]
140148
)
141149
}
150+
151+
DataFlow::Node getSourceNode(SourceBase source, Private::SummaryComponent sc) { none() }
152+
153+
DataFlow::Node getSinkNode(SinkBase sink, Private::SummaryComponent sc) { none() }
142154
}
143155

144156
module Steps = Private::Steps<FlowSummaryStepInput>;

shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll

+3-2
Original file line numberDiff line numberDiff line change
@@ -2154,8 +2154,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
21542154
pragma[nomagic]
21552155
private predicate storeStepFwd(NodeEx node1, Ap ap1, Content c, NodeEx node2, Ap ap2) {
21562156
fwdFlowStore(node1, _, ap1, _, c, _, _, node2, _, _, _) and
2157-
ap2 = apCons(c, ap1) and
2158-
readStepFwd(_, ap2, c, _, _)
2157+
readStepFwd(_, ap2, c, _, ap1)
21592158
}
21602159

21612160
pragma[nomagic]
@@ -4393,6 +4392,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
43934392
Typ getTyp(DataFlowType t) { result = t }
43944393

43954394
bindingset[c, tail]
4395+
pragma[inline_late]
43964396
Ap apCons(Content c, Ap tail) { result.isCons(c, tail) }
43974397

43984398
class ApHeadContent = Content;
@@ -4462,6 +4462,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
44624462
abstract Content getHead();
44634463

44644464
/** Holds if this is a representation of `head` followed by `tail`. */
4465+
pragma[nomagic]
44654466
abstract predicate isCons(Content head, AccessPath tail);
44664467

44674468
/** Gets the front of this access path. */

0 commit comments

Comments
 (0)