Fix for r364686 - actually set symbol_is_missing_weak...
authorJim Ingham <jingham@apple.com>
Tue, 2 Jul 2019 23:38:07 +0000 (23:38 +0000)
committerJim Ingham <jingham@apple.com>
Tue, 2 Jul 2019 23:38:07 +0000 (23:38 +0000)
This was set in a std::function, but I was shadowing a
variable that I thought I was capturing.  Even with this bug
we were correctly not raising an error and returning an address
of 0x0.  We were not marking the symbol as weak, but apparently
the JIT didn't need that, so the test still passed.

llvm-svn: 364980

lldb/source/Expression/IRExecutionUnit.cpp

index da74966..00e12f3 100644 (file)
@@ -791,7 +791,8 @@ lldb::addr_t IRExecutionUnit::FindInSymbols(
 
     std::function<bool(lldb::addr_t &, SymbolContextList &,
                        const lldb_private::SymbolContext &)>
-        get_external_load_address = [&best_internal_load_address, target](
+        get_external_load_address = [&best_internal_load_address, target,
+                                     &symbol_was_missing_weak](
             lldb::addr_t &load_address, SymbolContextList &sc_list,
             const lldb_private::SymbolContext &sc) -> lldb::addr_t {
       load_address = LLDB_INVALID_ADDRESS;
@@ -801,7 +802,7 @@ lldb::addr_t IRExecutionUnit::FindInSymbols(
 
       // missing_weak_symbol will be true only if we found only weak undefined 
       // references to this symbol.
-      bool symbol_was_missing_weak = true;      
+      symbol_was_missing_weak = true;      
       for (auto candidate_sc : sc_list.SymbolContexts()) {        
         // Only symbols can be weak undefined:
         if (!candidate_sc.symbol)