From a79e3cf6040951720d60f94cae0b47071f0a56e3 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Tue, 24 Jun 2025 10:00:26 -0700 Subject: [PATCH] QLDoc scripts: Fix overly permissive regex ranges The range `A-aa-z` was too permissive and includes special characters between `Z` and `a`. Low impact, but fix to address an internally reported code scanning alert. --- config/opcode-qldoc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/opcode-qldoc.py b/config/opcode-qldoc.py index e379e6a3ea96..1c892ee3c85b 100644 --- a/config/opcode-qldoc.py +++ b/config/opcode-qldoc.py @@ -8,9 +8,9 @@ start_qldoc_re = re.compile(r'^\s*/\*\*') # Start of a QLDoc comment end_qldoc_re = re.compile(r'\*/\s*$') # End of a QLDoc comment blank_qldoc_line_re = re.compile(r'^\s*\*\s*$') # A line in a QLDoc comment with only the '*' -instruction_class_re = re.compile(r'^class (?P[A-aa-z0-9]+)Instruction\s') # Declaration of an `Instruction` class -opcode_base_class_re = re.compile(r'^abstract class (?P[A-aa-z0-9]+)Opcode\s') # Declaration of an `Opcode` base class -opcode_class_re = re.compile(r'^ class (?P[A-aa-z0-9]+)\s') # Declaration of an `Opcode` class +instruction_class_re = re.compile(r'^class (?P[A-Za-z0-9]+)Instruction\s') # Declaration of an `Instruction` class +opcode_base_class_re = re.compile(r'^abstract class (?P[A-Za-z0-9]+)Opcode\s') # Declaration of an `Opcode` base class +opcode_class_re = re.compile(r'^ class (?P[A-Za-z0-9]+)\s') # Declaration of an `Opcode` class script_dir = path.realpath(path.dirname(__file__)) instruction_path = path.realpath(path.join(script_dir, '../cpp/ql/src/semmle/code/cpp/ir/implementation/raw/Instruction.qll'))