sanitize global cache access in pickler generation