ted created this revision. ted added reviewers: spyffe, zturner, amccarth. ted added a subscriber: lldb-commits.
From Adrian McCarthy: "Running ninja check-lldb now has one crash in a Python process, due to deferencing a null pointer in IRExecutionUnit.cpp: candidate_sc.symbol is null, which leads to a call with a null this pointer." http://reviews.llvm.org/D17860 Files: source/Expression/IRExecutionUnit.cpp Index: source/Expression/IRExecutionUnit.cpp =================================================================== --- source/Expression/IRExecutionUnit.cpp +++ source/Expression/IRExecutionUnit.cpp @@ -796,27 +796,28 @@ sc_list.GetContextAtIndex(si, candidate_sc); - const bool is_external = (candidate_sc.function) || - (candidate_sc.symbol && candidate_sc.symbol->IsExternal()); + if (candidate_sc.symbol) + { - load_address = candidate_sc.symbol->ResolveCallableAddress(*target); + load_address = candidate_sc.symbol->ResolveCallableAddress(*target); - if (load_address == LLDB_INVALID_ADDRESS) - if (target->GetProcessSP()) - load_address = candidate_sc.symbol->GetAddress().GetLoadAddress(target); - else - load_address = candidate_sc.symbol->GetAddress().GetFileAddress(); + if (load_address == LLDB_INVALID_ADDRESS) + if (target->GetProcessSP()) + load_address = candidate_sc.symbol->GetAddress().GetLoadAddress(target); + else + load_address = candidate_sc.symbol->GetAddress().GetFileAddress(); - if (load_address != LLDB_INVALID_ADDRESS) - { - if (is_external) - { - return true; - } - else if (best_internal_load_address == LLDB_INVALID_ADDRESS) + if (load_address != LLDB_INVALID_ADDRESS) { - best_internal_load_address = load_address; - load_address = LLDB_INVALID_ADDRESS; + if (candidate_sc.function || candidate_sc.symbol->IsExternal()) + { + return true; + } + else if (best_internal_load_address == LLDB_INVALID_ADDRESS) + { + best_internal_load_address = load_address; + load_address = LLDB_INVALID_ADDRESS; + } } } }
Index: source/Expression/IRExecutionUnit.cpp =================================================================== --- source/Expression/IRExecutionUnit.cpp +++ source/Expression/IRExecutionUnit.cpp @@ -796,27 +796,28 @@ sc_list.GetContextAtIndex(si, candidate_sc); - const bool is_external = (candidate_sc.function) || - (candidate_sc.symbol && candidate_sc.symbol->IsExternal()); + if (candidate_sc.symbol) + { - load_address = candidate_sc.symbol->ResolveCallableAddress(*target); + load_address = candidate_sc.symbol->ResolveCallableAddress(*target); - if (load_address == LLDB_INVALID_ADDRESS) - if (target->GetProcessSP()) - load_address = candidate_sc.symbol->GetAddress().GetLoadAddress(target); - else - load_address = candidate_sc.symbol->GetAddress().GetFileAddress(); + if (load_address == LLDB_INVALID_ADDRESS) + if (target->GetProcessSP()) + load_address = candidate_sc.symbol->GetAddress().GetLoadAddress(target); + else + load_address = candidate_sc.symbol->GetAddress().GetFileAddress(); - if (load_address != LLDB_INVALID_ADDRESS) - { - if (is_external) - { - return true; - } - else if (best_internal_load_address == LLDB_INVALID_ADDRESS) + if (load_address != LLDB_INVALID_ADDRESS) { - best_internal_load_address = load_address; - load_address = LLDB_INVALID_ADDRESS; + if (candidate_sc.function || candidate_sc.symbol->IsExternal()) + { + return true; + } + else if (best_internal_load_address == LLDB_INVALID_ADDRESS) + { + best_internal_load_address = load_address; + load_address = LLDB_INVALID_ADDRESS; + } } } }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits