Skip to content

Commit ee58dbc

Browse files
committed
Add new built-ins to builtinFunction predicate
- `clear` isn't pure because it modifies a data structure in place - `clear` may not be used correctly, but this is determined statically
1 parent b95effe commit ee58dbc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

go/ql/lib/semmle/go/Scopes.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,8 @@ private predicate builtinFunction(
678678
or
679679
name = "cap" and pure = true and mayPanic = false and mustPanic = false and variadic = false
680680
or
681+
name = "clear" and pure = false and mayPanic = false and mustPanic = false and variadic = false
682+
or
681683
name = "close" and pure = false and mayPanic = true and mustPanic = false and variadic = false
682684
or
683685
name = "complex" and pure = true and mayPanic = true and mustPanic = false and variadic = false
@@ -692,6 +694,10 @@ private predicate builtinFunction(
692694
or
693695
name = "make" and pure = true and mayPanic = true and mustPanic = false and variadic = true
694696
or
697+
name = "max" and pure = true and mayPanic = false and mustPanic = false and variadic = true
698+
or
699+
name = "min" and pure = true and mayPanic = false and mustPanic = false and variadic = true
700+
or
695701
name = "new" and pure = true and mayPanic = false and mustPanic = false and variadic = false
696702
or
697703
name = "panic" and pure = false and mayPanic = true and mustPanic = true and variadic = false

0 commit comments

Comments
 (0)