File tree Expand file tree Collapse file tree
cpp/ql/lib/semmle/code/cpp/ir/implementation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -295,6 +295,11 @@ abstract class MemoryLocation0 extends TMemoryLocation {
295295 */
296296abstract class VirtualVariable extends MemoryLocation0 { }
297297
298+ pragma [ nomagic]
299+ private VirtualVariable getAllocationMemoryLocation ( Allocation alloc ) {
300+ result .getAnAllocation ( ) = alloc
301+ }
302+
298303abstract class AllocationMemoryLocation extends MemoryLocation0 {
299304 Allocation var ;
300305 boolean isMayAccess ;
@@ -313,7 +318,7 @@ abstract class AllocationMemoryLocation extends MemoryLocation0 {
313318 result = getGroupedMemoryLocation ( var , false , false ) .getVirtualVariable ( )
314319 or
315320 not exists ( getGroupedMemoryLocation ( var , false , false ) ) and
316- result . ( AllocationMemoryLocation ) . getAnAllocation ( ) = var
321+ result = getAllocationMemoryLocation ( var )
317322 )
318323 }
319324
Original file line number Diff line number Diff line change @@ -618,6 +618,11 @@ class TranslatedExplicitFieldInitialization extends TranslatedNonDefaultFieldIni
618618 override int getPosition ( ) { result = position }
619619}
620620
621+ pragma [ nomagic]
622+ private Instruction getCallInstruction ( TranslatedDefaultFieldInitialization tdfi ) {
623+ result = tdfi .getInstruction ( CallTag ( ) )
624+ }
625+
621626/**
622627 * The IR translation of the initialization of a field from an element of an initializer
623628 * list where default initialization is used.
@@ -642,7 +647,7 @@ class TranslatedDefaultFieldInitialization extends TranslatedFieldInitialization
642647
643648 override Instruction getInstructionSuccessorInternal ( InstructionTag tag , EdgeKind kind ) {
644649 tag = CallTargetTag ( ) and
645- result = this . getInstruction ( CallTag ( ) )
650+ result = getCallInstruction ( this )
646651 or
647652 tag = CallTag ( ) and
648653 result = this .getSideEffects ( ) .getFirstInstruction ( kind )
You can’t perform that action at this time.
0 commit comments