File tree Expand file tree Collapse file tree
cpp/ql/src/semmle/code/cpp/ir/implementation
csharp/ql/src/semmle/code/csharp/ir/implementation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ abstract class RelationalOpcode extends CompareOpcode { }
110110
111111abstract class CopyOpcode extends Opcode { }
112112
113+ abstract class ConvertToBaseOpcode extends UnaryOpcode { }
114+
113115abstract class MemoryAccessOpcode extends Opcode { }
114116
115117abstract class ReturnOpcode extends Opcode { }
@@ -302,11 +304,11 @@ module Opcode {
302304 final override string toString ( ) { result = "Convert" }
303305 }
304306
305- class ConvertToNonVirtualBase extends UnaryOpcode , TConvertToNonVirtualBase {
307+ class ConvertToNonVirtualBase extends ConvertToBaseOpcode , TConvertToNonVirtualBase {
306308 final override string toString ( ) { result = "ConvertToNonVirtualBase" }
307309 }
308310
309- class ConvertToVirtualBase extends UnaryOpcode , TConvertToVirtualBase {
311+ class ConvertToVirtualBase extends ConvertToBaseOpcode , TConvertToVirtualBase {
310312 final override string toString ( ) { result = "ConvertToVirtualBase" }
311313 }
312314
Original file line number Diff line number Diff line change @@ -980,15 +980,23 @@ class InheritanceConversionInstruction extends UnaryInstruction {
980980 * Represents an instruction that converts from the address of a derived class
981981 * to the address of a direct non-virtual base class.
982982 */
983- class ConvertToNonVirtualBaseInstruction extends InheritanceConversionInstruction {
983+ class ConvertToBaseInstruction extends InheritanceConversionInstruction {
984+ ConvertToBaseInstruction ( ) { getOpcode ( ) instanceof ConvertToBaseOpcode }
985+ }
986+
987+ /**
988+ * Represents an instruction that converts from the address of a derived class
989+ * to the address of a direct non-virtual base class.
990+ */
991+ class ConvertToNonVirtualBaseInstruction extends ConvertToBaseInstruction {
984992 ConvertToNonVirtualBaseInstruction ( ) { getOpcode ( ) instanceof Opcode:: ConvertToNonVirtualBase }
985993}
986994
987995/**
988996 * Represents an instruction that converts from the address of a derived class
989997 * to the address of a virtual base class.
990998 */
991- class ConvertToVirtualBaseInstruction extends InheritanceConversionInstruction {
999+ class ConvertToVirtualBaseInstruction extends ConvertToBaseInstruction {
9921000 ConvertToVirtualBaseInstruction ( ) { getOpcode ( ) instanceof Opcode:: ConvertToVirtualBase }
9931001}
9941002
Original file line number Diff line number Diff line change @@ -980,15 +980,23 @@ class InheritanceConversionInstruction extends UnaryInstruction {
980980 * Represents an instruction that converts from the address of a derived class
981981 * to the address of a direct non-virtual base class.
982982 */
983- class ConvertToNonVirtualBaseInstruction extends InheritanceConversionInstruction {
983+ class ConvertToBaseInstruction extends InheritanceConversionInstruction {
984+ ConvertToBaseInstruction ( ) { getOpcode ( ) instanceof ConvertToBaseOpcode }
985+ }
986+
987+ /**
988+ * Represents an instruction that converts from the address of a derived class
989+ * to the address of a direct non-virtual base class.
990+ */
991+ class ConvertToNonVirtualBaseInstruction extends ConvertToBaseInstruction {
984992 ConvertToNonVirtualBaseInstruction ( ) { getOpcode ( ) instanceof Opcode:: ConvertToNonVirtualBase }
985993}
986994
987995/**
988996 * Represents an instruction that converts from the address of a derived class
989997 * to the address of a virtual base class.
990998 */
991- class ConvertToVirtualBaseInstruction extends InheritanceConversionInstruction {
999+ class ConvertToVirtualBaseInstruction extends ConvertToBaseInstruction {
9921000 ConvertToVirtualBaseInstruction ( ) { getOpcode ( ) instanceof Opcode:: ConvertToVirtualBase }
9931001}
9941002
Original file line number Diff line number Diff line change @@ -980,15 +980,23 @@ class InheritanceConversionInstruction extends UnaryInstruction {
980980 * Represents an instruction that converts from the address of a derived class
981981 * to the address of a direct non-virtual base class.
982982 */
983- class ConvertToNonVirtualBaseInstruction extends InheritanceConversionInstruction {
983+ class ConvertToBaseInstruction extends InheritanceConversionInstruction {
984+ ConvertToBaseInstruction ( ) { getOpcode ( ) instanceof ConvertToBaseOpcode }
985+ }
986+
987+ /**
988+ * Represents an instruction that converts from the address of a derived class
989+ * to the address of a direct non-virtual base class.
990+ */
991+ class ConvertToNonVirtualBaseInstruction extends ConvertToBaseInstruction {
984992 ConvertToNonVirtualBaseInstruction ( ) { getOpcode ( ) instanceof Opcode:: ConvertToNonVirtualBase }
985993}
986994
987995/**
988996 * Represents an instruction that converts from the address of a derived class
989997 * to the address of a virtual base class.
990998 */
991- class ConvertToVirtualBaseInstruction extends InheritanceConversionInstruction {
999+ class ConvertToVirtualBaseInstruction extends ConvertToBaseInstruction {
9921000 ConvertToVirtualBaseInstruction ( ) { getOpcode ( ) instanceof Opcode:: ConvertToVirtualBase }
9931001}
9941002
Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ abstract class RelationalOpcode extends CompareOpcode { }
110110
111111abstract class CopyOpcode extends Opcode { }
112112
113+ abstract class ConvertToBaseOpcode extends UnaryOpcode { }
114+
113115abstract class MemoryAccessOpcode extends Opcode { }
114116
115117abstract class ReturnOpcode extends Opcode { }
@@ -302,11 +304,11 @@ module Opcode {
302304 final override string toString ( ) { result = "Convert" }
303305 }
304306
305- class ConvertToNonVirtualBase extends UnaryOpcode , TConvertToNonVirtualBase {
307+ class ConvertToNonVirtualBase extends ConvertToBaseOpcode , TConvertToNonVirtualBase {
306308 final override string toString ( ) { result = "ConvertToNonVirtualBase" }
307309 }
308310
309- class ConvertToVirtualBase extends UnaryOpcode , TConvertToVirtualBase {
311+ class ConvertToVirtualBase extends ConvertToBaseOpcode , TConvertToVirtualBase {
310312 final override string toString ( ) { result = "ConvertToVirtualBase" }
311313 }
312314
Original file line number Diff line number Diff line change @@ -980,15 +980,23 @@ class InheritanceConversionInstruction extends UnaryInstruction {
980980 * Represents an instruction that converts from the address of a derived class
981981 * to the address of a direct non-virtual base class.
982982 */
983- class ConvertToNonVirtualBaseInstruction extends InheritanceConversionInstruction {
983+ class ConvertToBaseInstruction extends InheritanceConversionInstruction {
984+ ConvertToBaseInstruction ( ) { getOpcode ( ) instanceof ConvertToBaseOpcode }
985+ }
986+
987+ /**
988+ * Represents an instruction that converts from the address of a derived class
989+ * to the address of a direct non-virtual base class.
990+ */
991+ class ConvertToNonVirtualBaseInstruction extends ConvertToBaseInstruction {
984992 ConvertToNonVirtualBaseInstruction ( ) { getOpcode ( ) instanceof Opcode:: ConvertToNonVirtualBase }
985993}
986994
987995/**
988996 * Represents an instruction that converts from the address of a derived class
989997 * to the address of a virtual base class.
990998 */
991- class ConvertToVirtualBaseInstruction extends InheritanceConversionInstruction {
999+ class ConvertToVirtualBaseInstruction extends ConvertToBaseInstruction {
9921000 ConvertToVirtualBaseInstruction ( ) { getOpcode ( ) instanceof Opcode:: ConvertToVirtualBase }
9931001}
9941002
Original file line number Diff line number Diff line change @@ -980,15 +980,23 @@ class InheritanceConversionInstruction extends UnaryInstruction {
980980 * Represents an instruction that converts from the address of a derived class
981981 * to the address of a direct non-virtual base class.
982982 */
983- class ConvertToNonVirtualBaseInstruction extends InheritanceConversionInstruction {
983+ class ConvertToBaseInstruction extends InheritanceConversionInstruction {
984+ ConvertToBaseInstruction ( ) { getOpcode ( ) instanceof ConvertToBaseOpcode }
985+ }
986+
987+ /**
988+ * Represents an instruction that converts from the address of a derived class
989+ * to the address of a direct non-virtual base class.
990+ */
991+ class ConvertToNonVirtualBaseInstruction extends ConvertToBaseInstruction {
984992 ConvertToNonVirtualBaseInstruction ( ) { getOpcode ( ) instanceof Opcode:: ConvertToNonVirtualBase }
985993}
986994
987995/**
988996 * Represents an instruction that converts from the address of a derived class
989997 * to the address of a virtual base class.
990998 */
991- class ConvertToVirtualBaseInstruction extends InheritanceConversionInstruction {
999+ class ConvertToVirtualBaseInstruction extends ConvertToBaseInstruction {
9921000 ConvertToVirtualBaseInstruction ( ) { getOpcode ( ) instanceof Opcode:: ConvertToVirtualBase }
9931001}
9941002
You can’t perform that action at this time.
0 commit comments