Skip to content

Commit 7da3dc4

Browse files
[libc] move newheadergen back to safe_load
In llvm#100024 we moved from safe_load to load for reading the yaml in newheadergen due to dependency issues. Those should be resolved by now so this should be a simple safety improvement.
1 parent 2353f48 commit 7da3dc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libc/newhdrgen/yaml_to_classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def load_yaml_file(yaml_file, header_class, entry_points):
118118
HeaderFile: An instance of HeaderFile populated with the data.
119119
"""
120120
with open(yaml_file, "r") as f:
121-
yaml_data = yaml.load(f, Loader=yaml.FullLoader)
121+
yaml_data = yaml.safe_load(f)
122122
return yaml_to_classes(yaml_data, header_class, entry_points)
123123

124124

@@ -173,7 +173,7 @@ def add_function_to_yaml(yaml_file, function_details):
173173
new_function = parse_function_details(function_details)
174174

175175
with open(yaml_file, "r") as f:
176-
yaml_data = yaml.load(f, Loader=yaml.FullLoader)
176+
yaml_data = yaml.safe_load(f)
177177
if "functions" not in yaml_data:
178178
yaml_data["functions"] = []
179179

0 commit comments

Comments
 (0)