Fix a bug introduced in r235737 where code with important side

effects was passed as an expression to assert() calls.  If lldb is
built without asserts, the expression was eliminated and we lost
the side effects -- these methods stopped working.  

<rdar://problem/30342959> 

llvm-svn: 295271
This commit is contained in:
Jason Molenda 2017-02-16 02:08:33 +00:00
parent d3e5cb77e4
commit a1a864631a
2 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,8 @@ static bool FileAtPathContainsArchAndUUID(const FileSpec &file_fspec,
if (ObjectFile::GetModuleSpecifications(file_fspec, 0, 0, module_specs)) {
ModuleSpec spec;
for (size_t i = 0; i < module_specs.GetSize(); ++i) {
assert(module_specs.GetModuleSpecAtIndex(i, spec));
bool got_spec = module_specs.GetModuleSpecAtIndex(i, spec);
assert(got_spec);
if ((uuid == NULL || (spec.GetUUIDPtr() && spec.GetUUID() == *uuid)) &&
(arch == NULL || (spec.GetArchitecturePtr() &&
spec.GetArchitecture().IsCompatibleMatch(*arch)))) {

View File

@ -263,7 +263,8 @@ FileSpec Symbols::FindSymbolFileInBundle(const FileSpec &dsym_bundle_fspec,
module_specs)) {
ModuleSpec spec;
for (size_t i = 0; i < module_specs.GetSize(); ++i) {
assert(module_specs.GetModuleSpecAtIndex(i, spec));
bool got_spec = module_specs.GetModuleSpecAtIndex(i, spec);
assert(got_spec);
if ((uuid == NULL ||
(spec.GetUUIDPtr() && spec.GetUUID() == *uuid)) &&
(arch == NULL ||