File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -837,7 +837,7 @@ impl WarpFileProcessor {
837837 ) -> Result < HashMap < Target , Vec < SignatureChunk < ' static > > > , ProcessingError > {
838838 let is_function_named = |f : & Guard < BNFunction > | {
839839 self . included_functions == IncludedFunctionsField :: All
840- || view . symbol_by_address ( f . start ( ) ) . is_some ( )
840+ || f . defined_symbol ( ) . is_some ( )
841841 || f. has_user_annotations ( )
842842 } ;
843843 let is_function_tagged = |f : & Guard < BNFunction > | {
Original file line number Diff line number Diff line change @@ -338,13 +338,23 @@ impl Function {
338338 }
339339 }
340340
341+ /// Returns the symbol at the function start address or a default symbol.
342+ ///
343+ /// NOTE: If you want to only get the symbol if there is actually a symbol, use [`Function::defined_symbol`].
341344 pub fn symbol ( & self ) -> Ref < Symbol > {
342345 unsafe {
343346 let sym = BNGetFunctionSymbol ( self . handle ) ;
344347 Symbol :: ref_from_raw ( sym)
345348 }
346349 }
347350
351+ /// Returns the symbol at the function start address or `None` if there is no symbol.
352+ ///
353+ /// NOTE: If you want to get a default "sub_X" symbol use [`Function::symbol`].
354+ pub fn defined_symbol ( & self ) -> Option < Ref < Symbol > > {
355+ self . view ( ) . symbol_by_address ( self . start ( ) )
356+ }
357+
348358 /// Returns true when the function's symbol binding marks it as exported.
349359 pub fn is_exported ( & self ) -> bool {
350360 let symbol = self . symbol ( ) ;
You can’t perform that action at this time.
0 commit comments