Skip to content

Commit 26715fc

Browse files
committed
C++: Rename rst to convSpec
1 parent 19c4b2f commit 26715fc

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

cpp/ql/lib/semmle/code/cpp/commons/Printf.qll

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -531,20 +531,20 @@ class FormatLiteral extends Literal instanceof StringLiteral {
531531
int n, string spec, string params, string flags, string width, string prec, string len,
532532
string conv
533533
) {
534-
exists(string rst, string regexp |
535-
rst = this.getConvSpecString(n) and
534+
exists(string convSpec, string regexp |
535+
convSpec = this.getConvSpecString(n) and
536536
regexp = this.getConvSpecRegexp() and
537537
(
538-
spec = rst.regexpCapture(regexp, 1) and
539-
params = rst.regexpCapture(regexp, 2) and
540-
flags = rst.regexpCapture(regexp, 3) and
541-
width = rst.regexpCapture(regexp, 4) and
542-
prec = rst.regexpCapture(regexp, 5) and
543-
len = rst.regexpCapture(regexp, 6) and
544-
conv = rst.regexpCapture(regexp, 7)
538+
spec = convSpec.regexpCapture(regexp, 1) and
539+
params = convSpec.regexpCapture(regexp, 2) and
540+
flags = convSpec.regexpCapture(regexp, 3) and
541+
width = convSpec.regexpCapture(regexp, 4) and
542+
prec = convSpec.regexpCapture(regexp, 5) and
543+
len = convSpec.regexpCapture(regexp, 6) and
544+
conv = convSpec.regexpCapture(regexp, 7)
545545
or
546-
spec = rst.regexpCapture(regexp, 1) and
547-
not exists(rst.regexpCapture(regexp, 2)) and
546+
spec = convSpec.regexpCapture(regexp, 1) and
547+
not exists(convSpec.regexpCapture(regexp, 2)) and
548548
params = "" and
549549
flags = "" and
550550
width = "" and
@@ -559,10 +559,10 @@ class FormatLiteral extends Literal instanceof StringLiteral {
559559
* Gets the nth conversion specifier (including the initial `%`).
560560
*/
561561
string getConvSpec(int n) {
562-
exists(string rst, string regexp |
563-
rst = this.getConvSpecString(n) and
562+
exists(string convSpec, string regexp |
563+
convSpec = this.getConvSpecString(n) and
564564
regexp = this.getConvSpecRegexp() and
565-
result = rst.regexpCapture(regexp, 1)
565+
result = convSpec.regexpCapture(regexp, 1)
566566
)
567567
}
568568

cpp/ql/lib/semmle/code/cpp/commons/Scanf.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,14 @@ class ScanfFormatLiteral extends Expr {
234234
* specifier.
235235
*/
236236
predicate parseConvSpec(int n, string spec, string width, string len, string conv) {
237-
exists(string rst, string regexp |
238-
rst = this.getConvSpecString(n) and
237+
exists(string convSpec, string regexp |
238+
convSpec = this.getConvSpecString(n) and
239239
regexp = this.getConvSpecRegexp() and
240240
(
241-
spec = rst.regexpCapture(regexp, 1) and
242-
width = rst.regexpCapture(regexp, 2) and
243-
len = rst.regexpCapture(regexp, 3) and
244-
conv = rst.regexpCapture(regexp, 4)
241+
spec = convSpec.regexpCapture(regexp, 1) and
242+
width = convSpec.regexpCapture(regexp, 2) and
243+
len = convSpec.regexpCapture(regexp, 3) and
244+
conv = convSpec.regexpCapture(regexp, 4)
245245
)
246246
)
247247
}

0 commit comments

Comments
 (0)