From 9ddacf55a56ccb155966fd4651382054029dd373 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 26 Aug 2022 09:07:53 +0100 Subject: [PATCH] C++/C#: Sync identical files. --- .../gvn/internal/ValueNumberingInternal.qll | 3 ++- .../cpp/ir/implementation/raw/Instruction.qll | 20 ++++++------------- .../gvn/internal/ValueNumberingInternal.qll | 4 +++- .../unaliased_ssa/Instruction.qll | 20 ++++++------------- .../gvn/internal/ValueNumberingInternal.qll | 4 +++- .../ir/implementation/raw/Instruction.qll | 20 ++++++------------- .../gvn/internal/ValueNumberingInternal.qll | 4 +++- .../unaliased_ssa/Instruction.qll | 20 ++++++------------- .../gvn/internal/ValueNumberingInternal.qll | 4 +++- 9 files changed, 38 insertions(+), 61 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/internal/ValueNumberingInternal.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/internal/ValueNumberingInternal.qll index fce87447110..b764d804bc5 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/internal/ValueNumberingInternal.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/internal/ValueNumberingInternal.qll @@ -84,7 +84,8 @@ private predicate callPartialValueNumber( NumberableCallInstruction call, int index, TCallPartialValueNumber head ) { exists(call) and - index = 1 and head = TNilArgument() + index = 1 and + head = TNilArgument() or exists(TCallPartialValueNumber prev, TValueNumber prevVN | callPartialValueNumber(call, index - 1, pragma[only_bind_out](prev)) and diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll index 3679b9e9bce..264cc7d9bf6 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll @@ -1714,13 +1714,9 @@ class CallSideEffectInstruction extends SideEffectInstruction { CallSideEffectInstruction() { this.getOpcode() instanceof Opcode::CallSideEffect } /** Gets the operand for the value that will be read by this instruction */ - final SideEffectOperand getSideEffectOperand() { - result = this.getAnOperand() - } + final SideEffectOperand getSideEffectOperand() { result = this.getAnOperand() } - final Instruction getSideEffect() { - result = this.getAnOperand().getDef() - } + final Instruction getSideEffect() { result = this.getAnOperand().getDef() } } /** @@ -1732,15 +1728,11 @@ class CallSideEffectInstruction extends SideEffectInstruction { */ class CallReadSideEffectInstruction extends SideEffectInstruction { CallReadSideEffectInstruction() { this.getOpcode() instanceof Opcode::CallReadSideEffect } - - /** Gets the operand for the value that will be read by this instruction */ - final SideEffectOperand getSideEffectOperand() { - result = this.getAnOperand() - } - final Instruction getSideEffect() { - result = this.getAnOperand().getDef() - } + /** Gets the operand for the value that will be read by this instruction */ + final SideEffectOperand getSideEffectOperand() { result = this.getAnOperand() } + + final Instruction getSideEffect() { result = this.getAnOperand().getDef() } } /** diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/gvn/internal/ValueNumberingInternal.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/gvn/internal/ValueNumberingInternal.qll index d8862dcaa07..b764d804bc5 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/gvn/internal/ValueNumberingInternal.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/gvn/internal/ValueNumberingInternal.qll @@ -83,7 +83,9 @@ private predicate callValueNumber( private predicate callPartialValueNumber( NumberableCallInstruction call, int index, TCallPartialValueNumber head ) { - index = 1 and head = TNilArgument() + exists(call) and + index = 1 and + head = TNilArgument() or exists(TCallPartialValueNumber prev, TValueNumber prevVN | callPartialValueNumber(call, index - 1, pragma[only_bind_out](prev)) and diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll index 3679b9e9bce..264cc7d9bf6 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll @@ -1714,13 +1714,9 @@ class CallSideEffectInstruction extends SideEffectInstruction { CallSideEffectInstruction() { this.getOpcode() instanceof Opcode::CallSideEffect } /** Gets the operand for the value that will be read by this instruction */ - final SideEffectOperand getSideEffectOperand() { - result = this.getAnOperand() - } + final SideEffectOperand getSideEffectOperand() { result = this.getAnOperand() } - final Instruction getSideEffect() { - result = this.getAnOperand().getDef() - } + final Instruction getSideEffect() { result = this.getAnOperand().getDef() } } /** @@ -1732,15 +1728,11 @@ class CallSideEffectInstruction extends SideEffectInstruction { */ class CallReadSideEffectInstruction extends SideEffectInstruction { CallReadSideEffectInstruction() { this.getOpcode() instanceof Opcode::CallReadSideEffect } - - /** Gets the operand for the value that will be read by this instruction */ - final SideEffectOperand getSideEffectOperand() { - result = this.getAnOperand() - } - final Instruction getSideEffect() { - result = this.getAnOperand().getDef() - } + /** Gets the operand for the value that will be read by this instruction */ + final SideEffectOperand getSideEffectOperand() { result = this.getAnOperand() } + + final Instruction getSideEffect() { result = this.getAnOperand().getDef() } } /** diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingInternal.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingInternal.qll index d8862dcaa07..b764d804bc5 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingInternal.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingInternal.qll @@ -83,7 +83,9 @@ private predicate callValueNumber( private predicate callPartialValueNumber( NumberableCallInstruction call, int index, TCallPartialValueNumber head ) { - index = 1 and head = TNilArgument() + exists(call) and + index = 1 and + head = TNilArgument() or exists(TCallPartialValueNumber prev, TValueNumber prevVN | callPartialValueNumber(call, index - 1, pragma[only_bind_out](prev)) and diff --git a/csharp/ql/src/experimental/ir/implementation/raw/Instruction.qll b/csharp/ql/src/experimental/ir/implementation/raw/Instruction.qll index 3679b9e9bce..264cc7d9bf6 100644 --- a/csharp/ql/src/experimental/ir/implementation/raw/Instruction.qll +++ b/csharp/ql/src/experimental/ir/implementation/raw/Instruction.qll @@ -1714,13 +1714,9 @@ class CallSideEffectInstruction extends SideEffectInstruction { CallSideEffectInstruction() { this.getOpcode() instanceof Opcode::CallSideEffect } /** Gets the operand for the value that will be read by this instruction */ - final SideEffectOperand getSideEffectOperand() { - result = this.getAnOperand() - } + final SideEffectOperand getSideEffectOperand() { result = this.getAnOperand() } - final Instruction getSideEffect() { - result = this.getAnOperand().getDef() - } + final Instruction getSideEffect() { result = this.getAnOperand().getDef() } } /** @@ -1732,15 +1728,11 @@ class CallSideEffectInstruction extends SideEffectInstruction { */ class CallReadSideEffectInstruction extends SideEffectInstruction { CallReadSideEffectInstruction() { this.getOpcode() instanceof Opcode::CallReadSideEffect } - - /** Gets the operand for the value that will be read by this instruction */ - final SideEffectOperand getSideEffectOperand() { - result = this.getAnOperand() - } - final Instruction getSideEffect() { - result = this.getAnOperand().getDef() - } + /** Gets the operand for the value that will be read by this instruction */ + final SideEffectOperand getSideEffectOperand() { result = this.getAnOperand() } + + final Instruction getSideEffect() { result = this.getAnOperand().getDef() } } /** diff --git a/csharp/ql/src/experimental/ir/implementation/raw/gvn/internal/ValueNumberingInternal.qll b/csharp/ql/src/experimental/ir/implementation/raw/gvn/internal/ValueNumberingInternal.qll index d8862dcaa07..b764d804bc5 100644 --- a/csharp/ql/src/experimental/ir/implementation/raw/gvn/internal/ValueNumberingInternal.qll +++ b/csharp/ql/src/experimental/ir/implementation/raw/gvn/internal/ValueNumberingInternal.qll @@ -83,7 +83,9 @@ private predicate callValueNumber( private predicate callPartialValueNumber( NumberableCallInstruction call, int index, TCallPartialValueNumber head ) { - index = 1 and head = TNilArgument() + exists(call) and + index = 1 and + head = TNilArgument() or exists(TCallPartialValueNumber prev, TValueNumber prevVN | callPartialValueNumber(call, index - 1, pragma[only_bind_out](prev)) and diff --git a/csharp/ql/src/experimental/ir/implementation/unaliased_ssa/Instruction.qll b/csharp/ql/src/experimental/ir/implementation/unaliased_ssa/Instruction.qll index 3679b9e9bce..264cc7d9bf6 100644 --- a/csharp/ql/src/experimental/ir/implementation/unaliased_ssa/Instruction.qll +++ b/csharp/ql/src/experimental/ir/implementation/unaliased_ssa/Instruction.qll @@ -1714,13 +1714,9 @@ class CallSideEffectInstruction extends SideEffectInstruction { CallSideEffectInstruction() { this.getOpcode() instanceof Opcode::CallSideEffect } /** Gets the operand for the value that will be read by this instruction */ - final SideEffectOperand getSideEffectOperand() { - result = this.getAnOperand() - } + final SideEffectOperand getSideEffectOperand() { result = this.getAnOperand() } - final Instruction getSideEffect() { - result = this.getAnOperand().getDef() - } + final Instruction getSideEffect() { result = this.getAnOperand().getDef() } } /** @@ -1732,15 +1728,11 @@ class CallSideEffectInstruction extends SideEffectInstruction { */ class CallReadSideEffectInstruction extends SideEffectInstruction { CallReadSideEffectInstruction() { this.getOpcode() instanceof Opcode::CallReadSideEffect } - - /** Gets the operand for the value that will be read by this instruction */ - final SideEffectOperand getSideEffectOperand() { - result = this.getAnOperand() - } - final Instruction getSideEffect() { - result = this.getAnOperand().getDef() - } + /** Gets the operand for the value that will be read by this instruction */ + final SideEffectOperand getSideEffectOperand() { result = this.getAnOperand() } + + final Instruction getSideEffect() { result = this.getAnOperand().getDef() } } /** diff --git a/csharp/ql/src/experimental/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingInternal.qll b/csharp/ql/src/experimental/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingInternal.qll index d8862dcaa07..b764d804bc5 100644 --- a/csharp/ql/src/experimental/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingInternal.qll +++ b/csharp/ql/src/experimental/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingInternal.qll @@ -83,7 +83,9 @@ private predicate callValueNumber( private predicate callPartialValueNumber( NumberableCallInstruction call, int index, TCallPartialValueNumber head ) { - index = 1 and head = TNilArgument() + exists(call) and + index = 1 and + head = TNilArgument() or exists(TCallPartialValueNumber prev, TValueNumber prevVN | callPartialValueNumber(call, index - 1, pragma[only_bind_out](prev)) and