mirror of
https://github.com/github/codeql.git
synced 2025-12-21 11:16:30 +01:00
C++/C#: Fix phantom Chi definitions in PrintSSA
When `PrintSSA.qll` is imported, IR dumps will be annotated with the alias analysis information used during SSA construction. When printing this information, we incorrectly treated instructions at offset -1, which should only be `Phi` instructions, as `Chi` instructions for the instruction at offset 0. This produced phantom annotations, but did not affect the correctness of the actual IR.
This commit is contained in:
@@ -6,11 +6,12 @@ private import DebugSSA
|
|||||||
|
|
||||||
bindingset[offset]
|
bindingset[offset]
|
||||||
private string getKeySuffixForOffset(int offset) {
|
private string getKeySuffixForOffset(int offset) {
|
||||||
|
offset >= 0 and
|
||||||
if offset % 2 = 0 then result = "" else result = "_Chi"
|
if offset % 2 = 0 then result = "" else result = "_Chi"
|
||||||
}
|
}
|
||||||
|
|
||||||
bindingset[offset]
|
bindingset[offset]
|
||||||
private int getIndexForOffset(int offset) { result = offset / 2 }
|
private int getIndexForOffset(int offset) { offset >= 0 and result = offset / 2 }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property provide that dumps the memory access of each result. Useful for debugging SSA
|
* Property provide that dumps the memory access of each result. Useful for debugging SSA
|
||||||
|
|||||||
@@ -6,11 +6,12 @@ private import DebugSSA
|
|||||||
|
|
||||||
bindingset[offset]
|
bindingset[offset]
|
||||||
private string getKeySuffixForOffset(int offset) {
|
private string getKeySuffixForOffset(int offset) {
|
||||||
|
offset >= 0 and
|
||||||
if offset % 2 = 0 then result = "" else result = "_Chi"
|
if offset % 2 = 0 then result = "" else result = "_Chi"
|
||||||
}
|
}
|
||||||
|
|
||||||
bindingset[offset]
|
bindingset[offset]
|
||||||
private int getIndexForOffset(int offset) { result = offset / 2 }
|
private int getIndexForOffset(int offset) { offset >= 0 and result = offset / 2 }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property provide that dumps the memory access of each result. Useful for debugging SSA
|
* Property provide that dumps the memory access of each result. Useful for debugging SSA
|
||||||
|
|||||||
@@ -6,11 +6,12 @@ private import DebugSSA
|
|||||||
|
|
||||||
bindingset[offset]
|
bindingset[offset]
|
||||||
private string getKeySuffixForOffset(int offset) {
|
private string getKeySuffixForOffset(int offset) {
|
||||||
|
offset >= 0 and
|
||||||
if offset % 2 = 0 then result = "" else result = "_Chi"
|
if offset % 2 = 0 then result = "" else result = "_Chi"
|
||||||
}
|
}
|
||||||
|
|
||||||
bindingset[offset]
|
bindingset[offset]
|
||||||
private int getIndexForOffset(int offset) { result = offset / 2 }
|
private int getIndexForOffset(int offset) { offset >= 0 and result = offset / 2 }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property provide that dumps the memory access of each result. Useful for debugging SSA
|
* Property provide that dumps the memory access of each result. Useful for debugging SSA
|
||||||
|
|||||||
Reference in New Issue
Block a user