C++: Ensure that the instruction being compared is the result of the 'CallInstruction'.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-01-15 19:27:28 +00:00
parent 90faab456d
commit 01cbd2f7f1

View File

@@ -37,7 +37,7 @@ private string getEofValue() {
*/
private predicate checkedForEof(ScanfFunctionCall call) {
exists(IRGuardCondition gc |
exists(Instruction i | i.getUnconvertedResultExpression() = call |
exists(CallInstruction i | i.getUnconvertedResultExpression() = call |
exists(int val | gc.comparesEq(valueNumber(i).getAUse(), val, _, _) |
// call == EOF
val = getEofValue().toInt()