Skip to content

Commit

Permalink
Enable asan for unit tests on Darwin when compiling with clang.
Browse files Browse the repository at this point in the history
This immediately caught two bugs in things that were being unit-tested.

The Linux version fails to link for some reason, hence this is
Darwin-only.
  • Loading branch information
bzbarsky-apple committed Nov 17, 2021
1 parent 10be5f6 commit 462781b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ jobs:
run: |
for BUILD_TYPE in clang python_lib; do
case $BUILD_TYPE in
"clang") GN_ARGS='is_clang=true target_os="all"';;
"clang") GN_ARGS='is_clang=true target_os="all" is_asan=true';;
"python_lib") GN_ARGS='enable_rtti=true enable_pylib=true';;
esac
scripts/build/gn_gen.sh --args="$GN_ARGS"
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/bdx/BdxMessages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ size_t TransferInit::MessageSize() const
void TransferInit::LogMessage(bdx::MessageType messageType) const
{
char fd[kMaxFileDesignatorLen];
snprintf(fd, sizeof(fd), "%s", FileDesignator);
snprintf(fd, sizeof(fd), "%.*s", static_cast<int>(FileDesLength), FileDesignator);

switch (messageType)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class DLL_EXPORT UserDirectedCommissioningServer : public TransportMgrDelegate
* Get the cache of UDC Clients
*
*/
UDCClients<kMaxUDCClients> GetUDCClients() { return mUdcClients; }
UDCClients<kMaxUDCClients> & GetUDCClients() { return mUdcClients; }

/**
* Print the cache of UDC Clients
Expand Down

0 comments on commit 462781b

Please sign in to comment.