[Lldb-commits] [lldb] r295271 - Fix a bug introduced in r235737 where code with important side
Jason Molenda via lldb-commits
lldb-commits at lists.llvm.org
Wed Feb 15 18:08:33 PST 2017
Author: jmolenda
Date: Wed Feb 15 20:08:33 2017
New Revision: 295271
URL: http://llvm.org/viewvc/llvm-project?rev=295271&view=rev
Log:
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>
Modified:
lldb/trunk/source/Host/common/Symbols.cpp
lldb/trunk/source/Host/macosx/Symbols.cpp
Modified: lldb/trunk/source/Host/common/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=295271&r1=295270&r2=295271&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Symbols.cpp (original)
+++ lldb/trunk/source/Host/common/Symbols.cpp Wed Feb 15 20:08:33 2017
@@ -54,7 +54,8 @@ static bool FileAtPathContainsArchAndUUI
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)))) {
Modified: lldb/trunk/source/Host/macosx/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Symbols.cpp?rev=295271&r1=295270&r2=295271&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Symbols.cpp (original)
+++ lldb/trunk/source/Host/macosx/Symbols.cpp Wed Feb 15 20:08:33 2017
@@ -263,7 +263,8 @@ FileSpec Symbols::FindSymbolFileInBundle
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 ||
More information about the lldb-commits
mailing list