@@ -6416,7 +6416,7 @@ def define_auto_symbol(self, sym: '_types.CoreSymbol') -> None:
6416
6416
core .BNDefineAutoSymbol (self .handle , sym .handle )
6417
6417
6418
6418
def define_auto_symbol_and_var_or_function (
6419
- self , sym : '_types.CoreSymbol' , type : '_types.Type' , plat : Optional ['_platform.Platform' ] = None
6419
+ self , sym : '_types.CoreSymbol' , type : Optional [ '_types.Type' ] = None , plat : Optional ['_platform.Platform' ] = None , type_confidence : Optional [ int ] = 0
6420
6420
) -> Optional ['_types.CoreSymbol' ]:
6421
6421
"""
6422
6422
``define_auto_symbol_and_var_or_function`` Defines an "Auto" symbol, and a Variable/Function alongside it.
@@ -6426,6 +6426,7 @@ def define_auto_symbol_and_var_or_function(
6426
6426
:param sym: Symbol to define
6427
6427
:param type: Type for the function/variable being defined (can be None)
6428
6428
:param plat: Platform (optional)
6429
+ :param type_confidence: Optional confidence value for the type
6429
6430
:rtype: Optional[CoreSymbol]
6430
6431
"""
6431
6432
if plat is None :
@@ -6435,12 +6436,16 @@ def define_auto_symbol_and_var_or_function(
6435
6436
elif not isinstance (plat , _platform .Platform ):
6436
6437
raise ValueError ("Provided platform is not of type `Platform`" )
6437
6438
6439
+ tc = core .BNTypeWithConfidence ()
6440
+ tc .type = None
6441
+ tc .confidence = 0
6438
6442
if isinstance (type , _types .Type ):
6439
- type = type .handle
6443
+ tc .type = type .handle
6444
+ tc .confidence = type_confidence
6440
6445
elif type is not None :
6441
6446
raise ValueError ("Provided type is not of type `binaryninja.Type`" )
6442
6447
6443
- _sym = core .BNDefineAutoSymbolAndVariableOrFunction (self .handle , plat .handle , sym .handle , type )
6448
+ _sym = core .BNDefineAutoSymbolAndVariableOrFunction (self .handle , plat .handle , sym .handle , tc )
6444
6449
if _sym is None :
6445
6450
return None
6446
6451
return _types .CoreSymbol (_sym )
0 commit comments