@@ -29,12 +29,12 @@ using namespace std;
2929
3030struct SymbolQueueResolveContext
3131{
32- std::function<std::pair<Ref<Symbol>, Ref<Type>>()> resolve;
32+ std::function<std::pair<Ref<Symbol>, Confidence< Ref<Type> >>()> resolve;
3333};
3434
3535struct SymbolQueueAddContext
3636{
37- std::function<void (Symbol*, Type* )> add;
37+ std::function<void (Symbol*, const Confidence<Ref< Type>>& )> add;
3838};
3939
4040
@@ -3130,10 +3130,11 @@ void BinaryView::DefineAutoSymbol(Ref<Symbol> sym)
31303130}
31313131
31323132
3133- Ref<Symbol> BinaryView::DefineAutoSymbolAndVariableOrFunction (Ref<Platform> platform, Ref<Symbol> sym, Ref<Type> type)
3133+ Ref<Symbol> BinaryView::DefineAutoSymbolAndVariableOrFunction (Ref<Platform> platform, Ref<Symbol> sym, const Confidence< Ref<Type>>& type)
31343134{
3135+ BNTypeWithConfidence apiType = {type.GetValue () ? type.GetValue ()->GetObject () : nullptr , type.GetConfidence ()};
31353136 BNSymbol* result = BNDefineAutoSymbolAndVariableOrFunction (
3136- m_object, platform ? platform->GetObject () : nullptr , sym->GetObject (), type ? type-> GetObject () : nullptr );
3137+ m_object, platform ? platform->GetObject () : nullptr , sym->GetObject (), &apiType );
31373138 if (!result)
31383139 return nullptr ;
31393140 return new Symbol (result);
@@ -5694,28 +5695,29 @@ SymbolQueue::~SymbolQueue()
56945695}
56955696
56965697
5697- void SymbolQueue::ResolveCallback (void * ctxt, BNSymbol** symbol, BNType* * type)
5698+ void SymbolQueue::ResolveCallback (void * ctxt, BNSymbol** symbol, BNTypeWithConfidence * type)
56985699{
56995700 SymbolQueueResolveContext* resolve = (SymbolQueueResolveContext*)ctxt;
57005701 auto result = resolve->resolve ();
57015702 delete resolve;
57025703 *symbol = result.first ? BNNewSymbolReference (result.first ->GetObject ()) : nullptr ;
5703- *type = result.second ? BNNewTypeReference (result.second ->GetObject ()) : nullptr ;
5704+ type->type = result.second .GetValue () ? BNNewTypeReference (result.second .GetValue ()->GetObject ()) : nullptr ;
5705+ type->confidence = result.second .GetConfidence ();
57045706}
57055707
57065708
5707- void SymbolQueue::AddCallback (void * ctxt, BNSymbol* symbol, BNType * type)
5709+ void SymbolQueue::AddCallback (void * ctxt, BNSymbol* symbol, BNTypeWithConfidence * type)
57085710{
57095711 SymbolQueueAddContext* add = (SymbolQueueAddContext*)ctxt;
57105712 Ref<Symbol> apiSymbol = new Symbol (symbol);
5711- Ref<Type> apiType = new Type (type);
5713+ Confidence< Ref<Type>> apiType (type-> type ? new Type (type-> type ) : nullptr , type-> confidence );
57125714 add->add (apiSymbol, apiType);
57135715 delete add;
57145716}
57155717
57165718
57175719void SymbolQueue::Append (
5718- const std::function<std::pair<Ref<Symbol>, Ref<Type>>()>& resolve, const std::function<void(Symbol*, Type* )>& add)
5720+ const std::function<std::pair<Ref<Symbol>, Confidence< Ref<Type>>> ()>& resolve, const std::function<void(Symbol*, const Confidence<Ref< Type>>& )>& add)
57195721{
57205722 SymbolQueueResolveContext* resolveCtxt = new SymbolQueueResolveContext {resolve};
57215723 SymbolQueueAddContext* addCtxt = new SymbolQueueAddContext {add};
0 commit comments