diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-06-08 08:47:10 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-06-15 07:39:08 -0400 |
commit | fa6ef701adba1cb48535cac25fd43c742a82e40d (patch) | |
tree | 260e6b7232c595094dea9e545e7e9e5dbed17d12 /test/lint | |
parent | fa457fbd3387661e1973a8f4e5cc2def79e0c625 (diff) |
util: Add Assert identity function
The utility is primarily useful to dereference pointer types, which are
known to be not null at that time.
For example, the ArgsManager is known to exist when the wallets are
started. Instead of silently relying on that assumption, Assert can be
used to abort the program and avoid UB should the assumption ever be
violated.
Diffstat (limited to 'test/lint')
-rwxr-xr-x | test/lint/lint-assertions.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/lint/lint-assertions.sh b/test/lint/lint-assertions.sh index 1aacc09bcc..d30a8ca231 100755 --- a/test/lint/lint-assertions.sh +++ b/test/lint/lint-assertions.sh @@ -23,7 +23,7 @@ fi # Macro CHECK_NONFATAL(condition) should be used instead of assert for RPC code, where it # is undesirable to crash the whole program. See: src/util/check.h # src/rpc/server.cpp is excluded from this check since it's mostly meta-code. -OUTPUT=$(git grep -nE 'assert *\(.*\);' -- "src/rpc/" "src/wallet/rpc*" ":(exclude)src/rpc/server.cpp") +OUTPUT=$(git grep -nE '\<(A|a)ssert *\(.*\);' -- "src/rpc/" "src/wallet/rpc*" ":(exclude)src/rpc/server.cpp") if [[ ${OUTPUT} != "" ]]; then echo "CHECK_NONFATAL(condition) should be used instead of assert for RPC code." echo |