Skip to content

Commit 653ef9d

Browse files
author
Dave Bartolomeo
committed
C++: Improve consistency failure message for multiple MemoryLocations on a memory access.
1 parent 54b9f21 commit 653ef9d

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,10 @@ module SSAConsistency {
934934
locationCount > 1 and
935935
func = operand.getEnclosingIRFunction() and
936936
funcText = Language::getIdentityString(func.getFunction()) and
937-
message = "Operand has " + locationCount.toString() + " memory accesses in function '$@'."
937+
message =
938+
operand.getUse().toString() + " " + "Operand has " + locationCount.toString() +
939+
" memory accesses in function '$@': " +
940+
strictconcat(Alias::getOperandMemoryLocation(operand).toString(), ", ")
938941
)
939942
}
940943

cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,10 @@ module SSAConsistency {
934934
locationCount > 1 and
935935
func = operand.getEnclosingIRFunction() and
936936
funcText = Language::getIdentityString(func.getFunction()) and
937-
message = "Operand has " + locationCount.toString() + " memory accesses in function '$@'."
937+
message =
938+
operand.getUse().toString() + " " + "Operand has " + locationCount.toString() +
939+
" memory accesses in function '$@': " +
940+
strictconcat(Alias::getOperandMemoryLocation(operand).toString(), ", ")
938941
)
939942
}
940943

csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,10 @@ module SSAConsistency {
934934
locationCount > 1 and
935935
func = operand.getEnclosingIRFunction() and
936936
funcText = Language::getIdentityString(func.getFunction()) and
937-
message = "Operand has " + locationCount.toString() + " memory accesses in function '$@'."
937+
message =
938+
operand.getUse().toString() + " " + "Operand has " + locationCount.toString() +
939+
" memory accesses in function '$@': " +
940+
strictconcat(Alias::getOperandMemoryLocation(operand).toString(), ", ")
938941
)
939942
}
940943

0 commit comments

Comments
 (0)