Skip to content

Commit

Permalink
resolve todos
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-ronstadt committed Aug 23, 2024
1 parent ed45a09 commit 616cfb7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,40 @@
</recommendation>
<example>
<p>
TODO example
Function that uses float without protecting floating-point hardware state
</p>
<sample language="c"> <![CDATA[
// Example code
void float_used_bad()
{
float f = 0.0f;
f = f + 1.0f;
}
}]]>
</sample>
<p>
TODO example 2
Function that uses float with protected floating-point hardware state
</p>
<sample language="c"> <![CDATA[
// Example code
KFLOATING_SAVE saveData;
NTSTATUS status;
float f = 0.0f;
status = KeSaveFloatingPointState(&saveData);
for (int i = 0; i < 100; i++)
{
f = f + 1.0f;
}
KeRestoreFloatingPointState(&saveData);
}]]>
</sample>
</example>
<semmleNotes>
<p>
TODO notes
</p>
</semmleNotes>
<references>
<li>
<a href="example.com">
Example link
<a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/28110-floating-point-hardware-protect">
Warning C28110
</a>
</li>
</references>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ class FuncWithSafeFloatAccess extends Function {
// this function can call a function that uses float
)
}
// exists(Function fOuter |
// fOuter.calls*(this.getEnclosingFunction())
// )
}

class SafeFloatAccess extends VariableAccess {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"extensions": [
{
"name": "microsoft/windows-drivers",
"semanticVersion": "1.1.0+f597e2aeb1c508ba009aa330f303f43dfe0280e1",
"semanticVersion": "1.1.0+ed45a0947090dd9c23386d5d318ddc2662469c34",
"locations": [
{
"uri": "file:///C:/codeql-home/WDDST/src/",
Expand Down Expand Up @@ -186,7 +186,7 @@
"markdown": "Internal telemetry for the C++ extractor.\n\nNo action needed."
},
"level": "note",
"timeUtc": "2024-08-21T04:14:03.463+00:00",
"timeUtc": "2024-08-24T03:52:35.107+00:00",
"descriptor": {
"id": "cpp/extractor/summary",
"index": 1
Expand Down Expand Up @@ -241,7 +241,7 @@
"index": 0
},
"message": {
"text": "Use of float detected without protecting floating-point hardware state. [f](1), $@"
"text": "Use of float detected without protecting floating-point hardware state"
},
"locations": [
{
Expand All @@ -262,27 +262,7 @@
"partialFingerprints": {
"primaryLocationLineHash": "26ede89e4ff516da:1",
"primaryLocationStartColumnFingerprint": "0"
},
"relatedLocations": [
{
"id": 1,
"physicalLocation": {
"artifactLocation": {
"uri": "driver/driver_snippet.c",
"uriBaseId": "%SRCROOT%",
"index": 0
},
"region": {
"startLine": 35,
"startColumn": 5,
"endColumn": 6
}
},
"message": {
"text": "f"
}
}
]
}
},
{
"ruleId": "cpp/drivers/float-hardware-state-protection",
Expand All @@ -292,7 +272,7 @@
"index": 0
},
"message": {
"text": "Use of float detected without protecting floating-point hardware state. [f](1), $@"
"text": "Use of float detected without protecting floating-point hardware state"
},
"locations": [
{
Expand All @@ -313,27 +293,7 @@
"partialFingerprints": {
"primaryLocationLineHash": "26ede89e4ff516da:1",
"primaryLocationStartColumnFingerprint": "4"
},
"relatedLocations": [
{
"id": 1,
"physicalLocation": {
"artifactLocation": {
"uri": "driver/driver_snippet.c",
"uriBaseId": "%SRCROOT%",
"index": 0
},
"region": {
"startLine": 35,
"startColumn": 9,
"endColumn": 10
}
},
"message": {
"text": "f"
}
}
]
}
},
{
"ruleId": "cpp/drivers/float-hardware-state-protection",
Expand All @@ -343,7 +303,7 @@
"index": 0
},
"message": {
"text": "Use of float detected without protecting floating-point hardware state. [f](1), $@"
"text": "Use of float detected without protecting floating-point hardware state"
},
"locations": [
{
Expand All @@ -364,27 +324,7 @@
"partialFingerprints": {
"primaryLocationLineHash": "9c6e5f7e3e1f2dc2:1",
"primaryLocationStartColumnFingerprint": "0"
},
"relatedLocations": [
{
"id": 1,
"physicalLocation": {
"artifactLocation": {
"uri": "driver/driver_snippet.c",
"uriBaseId": "%SRCROOT%",
"index": 0
},
"region": {
"startLine": 17,
"startColumn": 5,
"endColumn": 6
}
},
"message": {
"text": "f"
}
}
]
}
},
{
"ruleId": "cpp/drivers/float-hardware-state-protection",
Expand All @@ -394,7 +334,7 @@
"index": 0
},
"message": {
"text": "Use of float detected without protecting floating-point hardware state. [f](1), $@"
"text": "Use of float detected without protecting floating-point hardware state"
},
"locations": [
{
Expand All @@ -415,27 +355,7 @@
"partialFingerprints": {
"primaryLocationLineHash": "9c6e5f7e3e1f2dc2:1",
"primaryLocationStartColumnFingerprint": "4"
},
"relatedLocations": [
{
"id": 1,
"physicalLocation": {
"artifactLocation": {
"uri": "driver/driver_snippet.c",
"uriBaseId": "%SRCROOT%",
"index": 0
},
"region": {
"startLine": 17,
"startColumn": 9,
"endColumn": 10
}
},
"message": {
"text": "f"
}
}
]
}
}
],
"columnKind": "utf16CodeUnits",
Expand Down

0 comments on commit 616cfb7

Please sign in to comment.