[opt-viewer] Use safe yaml load_all
authorYi Kong <yikong@google.com>
Thu, 21 Oct 2021 05:56:14 +0000 (13:56 +0800)
committerYi Kong <yikong@google.com>
Thu, 21 Oct 2021 06:00:03 +0000 (14:00 +0800)
Differential Revision: https://reviews.llvm.org/D112075

llvm/tools/opt-viewer/optrecord.py

index 6a53e13..bd5ef6c 100644 (file)
@@ -274,7 +274,7 @@ def get_remarks(input_file, filter_=None):
     file_remarks = defaultdict(functools.partial(defaultdict, list))
 
     with io.open(input_file, encoding = 'utf-8') as f:
-        docs = yaml.load_all(f, Loader=Loader)
+        docs = yaml.safe_load_all(f, Loader=Loader)
 
         filter_e = None
         if filter_: