let block_top_addresses_of_locals blocks =
   match List.flatten (List.map (fun b -> b.blocals) blocks) with
       [] ->
         fun x -> x (* no need to change the state if there is no local
                           variable
                         *)

       | _ ->
           let offsetmap_top_addresses_of_locals =
             offsetmap_top_addresses_of_locals
               (fun v -> List.exists (Base.is_block_local v) blocks)
           in
           let state_top_addresses_of_locals =
             state_top_addresses_of_locals ~is_block:true
             offsetmap_top_addresses_of_locals
             (Kernel_function.get_definition (current_kf()))
           in state_top_addresses_of_locals