@@ -162,6 +162,28 @@ def _get_function_implementation(self) -> str:
162162
163163 return function_source
164164
165+ def _get_macro_block (self ) -> list [str ]:
166+ """Queries FI to check macro block around this function."""
167+ project = self ._benchmark .project
168+ source = self ._benchmark .function_dict .get ('function_filename' , '' )
169+ start = self ._benchmark .function_dict .get ('source_line_begin' , 0 )
170+ end = self ._benchmark .function_dict .get ('source_end_begin' , 99999 )
171+ macro_block = introspector .query_introspector_macro_block (
172+ project , source , start , end )
173+
174+ results = set ()
175+ for macro in macro_block :
176+ conditions = macro .get ('conditions' , [])
177+ for condition in conditions :
178+ cond_type = condition .get ('type' )
179+ cond_detail = condition .get ('condition' )
180+ if not cond_type or not cond_detail :
181+ continue
182+
183+ results .add (f'#{ cond_type } { cond_detail } ' )
184+
185+ return list (results )
186+
165187 def _get_xrefs_to_function (self ) -> list [str ]:
166188 """Queries FI for function being fuzzed."""
167189 project = self ._benchmark .project
@@ -177,13 +199,15 @@ def _get_xrefs_to_function(self) -> list[str]:
177199 def get_context_info (self ) -> dict :
178200 """Retrieves contextual information and stores them in a dictionary."""
179201 xrefs = self ._get_xrefs_to_function ()
202+ macro = self ._get_macro_block ()
180203 func_source = self ._get_function_implementation ()
181204 files = self ._get_files_to_include ()
182205 decl = self ._get_embeddable_declaration ()
183206 header = self .get_prefixed_header_file ()
184207
185208 context_info = {
186209 'xrefs' : xrefs ,
210+ 'macro_block' : macro ,
187211 'func_source' : func_source ,
188212 'files' : files ,
189213 'decl' : decl ,
0 commit comments