Skip to content
This repository was archived by the owner on Jun 17, 2022. It is now read-only.

Import fixes for sanitizer reported issues #28

Merged
merged 4 commits into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
962 changes: 962 additions & 0 deletions build-aux/m4/ax_cxx_compile_stdcxx.m4

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ AC_SUBST(LIBUNIVALUE_AGE)
LT_INIT
LT_LANG([C++])

dnl Require C++11 compiler (no GNU extensions)
AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory], [nodefault])

case $host in
*mingw*)
LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"
Expand Down
2 changes: 1 addition & 1 deletion gen/gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static void outputEscape()

for (unsigned int i = 0; i < 256; i++) {
if (escapes[i].empty()) {
printf("\tNULL,\n");
printf("\tnullptr,\n");
} else {
printf("\t\"");

Expand Down
14 changes: 8 additions & 6 deletions lib/univalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,19 @@ bool UniValue::findKey(const std::string& key, size_t& retIdx) const

bool UniValue::checkObject(const std::map<std::string,UniValue::VType>& t) const
{
if (typ != VOBJ)
if (typ != VOBJ) {
return false;
}

for (std::map<std::string,UniValue::VType>::const_iterator it = t.begin();
it != t.end(); ++it) {
for (const auto& object: t) {
size_t idx = 0;
if (!findKey(it->first, idx))
if (!findKey(object.first, idx)) {
return false;
}

if (values.at(idx).getType() != it->second)
if (values.at(idx).getType() != object.second) {
return false;
}
}

return true;
Expand Down Expand Up @@ -228,7 +230,7 @@ const char *uvTypeName(UniValue::VType t)
}

// not reached
return NULL;
return nullptr;
}

const UniValue& find_value(const UniValue& obj, const std::string& name)
Expand Down
Loading