Skip to content

Commit bc2663d

Browse files
committed
WIP
1 parent 74f1b2c commit bc2663d

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedCall.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff 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.

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedInitialization.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,12 @@ TranslatedFieldInitialization getTranslatedFieldInitialization(
512512

513513
TranslatedElement getTranslatedConstructorFieldInitialization(ConstructorFieldInit init) {
514514
result.getAst() = init
515+
and
516+
(
517+
result instanceof TranslatedFieldInitialization
518+
or
519+
result instanceof TranslatedDefaultFieldInitialization
520+
)
515521
}
516522

517523
/**

0 commit comments

Comments
 (0)