Skip to content

Commit 6e36096

Browse files
committed
C#: Address review comments.
1 parent d32199c commit 6e36096

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

csharp/ql/src/Concurrency/Concurrency.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ private class WaitCall extends MethodCall {
1515
class WaitStmt extends ExprStmt {
1616
WaitStmt() { getExpr() instanceof WaitCall }
1717

18-
/** Gets the expression this wait call is waiting on. */
18+
/** Gets the expression that this wait call is waiting on. */
1919
Expr getLock() { result = getExpr().(WaitCall).getExpr() }
2020

21-
/** Gets the variable this wait call is waiting on, if any. */
21+
/** Gets the variable that this wait call is waiting on, if any. */
2222
Variable getWaitVariable() { result.getAnAccess() = getLock() }
2323

2424
/** Holds if this wait call waits on `this`. */
2525
predicate isWaitThis() { getLock() instanceof ThisAccess }
2626

27-
/** Gets the type this wait call waits on, if any. */
27+
/** Gets the type that this wait call waits on, if any. */
2828
Type getWaitTypeObject() { result = getLock().(TypeofExpr).getTypeAccess().getTarget() }
2929
}
3030

@@ -44,7 +44,7 @@ private class SynchronizedMethodAttribute extends Attribute {
4444
private class SynchronizedMethod extends Method {
4545
SynchronizedMethod() { getAnAttribute() instanceof SynchronizedMethodAttribute }
4646

47-
/** Holds if the method locks `this`. */
47+
/** Holds if this method locks `this`. */
4848
predicate isLockThis() { not isStatic() }
4949

5050
/** Gets the type that is locked by this method, if any. */

csharp/ql/src/Documentation/Documentation.qll

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ predicate isDocumentationNeeded(Modifiable decl) {
6161
class ReturnsXmlComment extends XmlComment {
6262
ReturnsXmlComment() { getOpenTag(_) = "returns" }
6363

64-
/** Holds if the element has a body at offset `offset`. */
64+
/** Holds if the element in this comment has a body at offset `offset`. */
6565
predicate hasBody(int offset) { hasBody("returns", offset) }
6666

67-
/** Holds if the element is an opening tag at offset `offset`. */
67+
/** Holds if the element in this comment is an opening tag at offset `offset`. */
6868
predicate isOpenTag(int offset) { "returns" = getOpenTag(offset) }
6969

70-
/** Holds if the element is an empty tag at offset `offset`. */
70+
/** Holds if the element in this comment is an empty tag at offset `offset`. */
7171
predicate isEmptyTag(int offset) { "returns" = getEmptyTag(offset) }
7272
}
7373

@@ -78,7 +78,7 @@ class ExceptionXmlComment extends XmlComment {
7878
/** Gets a `cref` attribute at offset `offset`, if any. */
7979
string getCref(int offset) { result = getAttribute("exception", "cref", offset) }
8080

81-
/** Holds if the element has a body at offset `offset`. */
81+
/** Holds if the element in this comment has a body at offset `offset`. */
8282
predicate hasBody(int offset) { hasBody("exception", offset) }
8383
}
8484

@@ -89,7 +89,7 @@ class ParamXmlComment extends XmlComment {
8989
/** Gets the name of this parameter at offset `offset`. */
9090
string getName(int offset) { getAttribute("param", "name", offset) = result }
9191

92-
/** Holds if the element has a body at offset `offset`. */
92+
/** Holds if the element in this comment has a body at offset `offset`. */
9393
predicate hasBody(int offset) { hasBody("param", offset) }
9494
}
9595

@@ -100,21 +100,21 @@ class TypeparamXmlComment extends XmlComment {
100100
/** Gets the `name` attribute of this element at offset `offset`. */
101101
string getName(int offset) { getAttribute("typeparam", "name", offset) = result }
102102

103-
/** Holds if the element has a body at offset `offset`. */
103+
/** Holds if the element in this comment has a body at offset `offset`. */
104104
predicate hasBody(int offset) { hasBody("typeparam", offset) }
105105
}
106106

107107
/** An XML comment containing a `<summary>` tag. */
108108
class SummaryXmlComment extends XmlComment {
109109
SummaryXmlComment() { getOpenTag(_) = "summary" }
110110

111-
/** Holds if the element has a body at offset `offset`. */
111+
/** Holds if the element in this comment has a body at offset `offset`. */
112112
predicate hasBody(int offset) { hasBody("summary", offset) }
113113

114-
/** Holds if the element has an open tag at offset `offset`. */
114+
/** Holds if the element in this comment has an open tag at offset `offset`. */
115115
predicate isOpenTag(int offset) { "summary" = getOpenTag(offset) }
116116

117-
/** Holds if the element is empty at offset `offset`. */
117+
/** Holds if the element in this comment is empty at offset `offset`. */
118118
predicate isEmptyTag(int offset) { "summary" = getEmptyTag(offset) }
119119
}
120120

csharp/ql/src/semmle/code/cil/Instructions.qll

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/**
22
* Provides classes representing individual opcodes.
3+
*
4+
* See ECMA-335 (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-335.pdf)
5+
* pages 32-101 for a detailed explanation of these instructions.
36
*/
47

58
private import CIL
@@ -365,7 +368,7 @@ module Opcodes {
365368
override string getOpcodeName() { result = "bge" }
366369
}
367370

368-
/** A `bne.un` instruction. */
371+
/** A `bne.un.s` instruction. */
369372
class Bne_un_s extends BinaryBranch, @cil_bne_un_s {
370373
override string getOpcodeName() { result = "bne.un.s" }
371374
}
@@ -407,7 +410,7 @@ module Opcodes {
407410

408411
/** A `bgt.in.s` instruction. */
409412
class Bgt_in_s extends BinaryBranch, @cil_bgt_un_s {
410-
override string getOpcodeName() { result = "bgt.un.s" }
413+
override string getOpcodeName() { result = "bgt.in.s" }
411414
}
412415

413416
/** A `bge.in.s` instruction. */
@@ -466,7 +469,7 @@ module Opcodes {
466469

467470
/** A `clt.un` instruction. */
468471
class Clt_un extends ComparisonOperation, @cil_clt_un {
469-
override string getOpcodeName() { result = "cgt.un" }
472+
override string getOpcodeName() { result = "clt.un" }
470473
}
471474

472475
/** A `clt` instruction. */
@@ -853,7 +856,7 @@ module Opcodes {
853856
override Type getType() { result = getAccess() }
854857
}
855858

856-
/** An `ldelem_ref` instruction. */
859+
/** An `ldelem.ref` instruction. */
857860
class Ldelem_ref extends ReadArrayElement, @cil_ldelem_ref {
858861
override string getOpcodeName() { result = "ldelem.ref" }
859862

@@ -1206,7 +1209,7 @@ module Opcodes {
12061209
override DoubleType getType() { exists(result) }
12071210
}
12081211

1209-
/** A `conv.r8.un` instruction. */
1212+
/** A `conv.r.un` instruction. */
12101213
class Conv_r_un extends Conversion, @cil_conv_r_un {
12111214
override string getOpcodeName() { result = "conv.r.un" }
12121215

@@ -1327,7 +1330,7 @@ module Opcodes {
13271330

13281331
/** An `stind.r8` instruction. */
13291332
class Stind_r8 extends StoreIndirect, @cil_stind_r8 {
1330-
override string getOpcodeName() { result = "stind.r4" }
1333+
override string getOpcodeName() { result = "stind.r8" }
13311334
}
13321335

13331336
/** An `stind.ref` instruction. */

0 commit comments

Comments
 (0)