File tree Expand file tree Collapse file tree 3 files changed +16
-10
lines changed
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -666,9 +666,9 @@ class TranslatedStructorQualifierSideEffect extends TranslatedArgumentSideEffect
666666 structorCall .getExpr ( ) = callOrInit and
667667 result = structorCall .getQualifierResult ( )
668668 )
669- // or
670- // callOrInit instanceof ConstructorFieldInit and
671- // result = getTranslatedFunction(callOrInit.getEnclosingFunction()).getLoadThisInstruction()
669+ or
670+ callOrInit instanceof ConstructorFieldInit and
671+ result = getTranslatedFunction ( callOrInit .getEnclosingFunction ( ) ) .getLoadThisInstruction ( )
672672 }
673673}
674674
Original file line number Diff line number Diff line change @@ -926,13 +926,13 @@ newtype TTranslatedElement =
926926 (
927927 call instanceof ConstructorCall and
928928 opcode = getASideEffectOpcode ( call , - 1 )
929- // or
930- // call instanceof ConstructorFieldInit and
931- // (
932- // opcode instanceof Opcode::IndirectReadSideEffect
933- // or
934- // opcode instanceof Opcode::IndirectMayWriteSideEffect
935- // )
929+ or
930+ call instanceof ConstructorFieldInit and
931+ (
932+ opcode instanceof Opcode:: IndirectReadSideEffect
933+ or
934+ opcode instanceof Opcode:: IndirectMayWriteSideEffect
935+ )
936936 )
937937 } or
938938 // The side effect that initializes newly-allocated memory.
Original file line number Diff line number Diff line change @@ -512,6 +512,12 @@ TranslatedFieldInitialization getTranslatedFieldInitialization(
512512
513513TranslatedElement getTranslatedConstructorFieldInitialization ( ConstructorFieldInit init ) {
514514 result .getAst ( ) = init
515+ and
516+ (
517+ result instanceof TranslatedFieldInitialization
518+ or
519+ result instanceof TranslatedDefaultFieldInitialization
520+ )
515521}
516522
517523/**
You can’t perform that action at this time.
0 commit comments