servo: Merge #14589 - Reduce calls into arbitrary code with the ScriptThread::documents borrow held (from servo:harden-script); r=jdm+Ms2ger

Source-Repo: https://github.com/servo/servo
Source-Revision: 0c56499bdc5c92bac44f8c33e4781899c34d64e1
This commit is contained in:
Josh Matthews
2016-12-16 08:53:27 -08:00
parent 6bef4d878a
commit be969dee6a
4 changed files with 97 additions and 52 deletions

View File

@@ -542,6 +542,9 @@ def check_rust(file_name, lines):
lambda match, line: line.startswith('use ')),
(r"^\s*else {", "else braces should be on the same line", no_filter),
(r"[^$ ]\([ \t]", "extra space after (", no_filter),
# This particular pattern is not reentrant-safe in script_thread.rs
(r"match self.documents.borrow", "use a separate variable for the match expression",
lambda match, line: file_name.endswith('script_thread.rs')),
]
for pattern, message, filter_func in regex_rules: