@@ -715,19 +715,13 @@ abstract class TranslatedPointerOps extends TranslatedNonConstantExpr {
715715}
716716
717717class TranslatedPointerIndirectionExpr extends TranslatedPointerOps {
718- TranslatedPointerIndirectionExpr ( ) {
719- // *p is the same as p until the result is loaded.
720- expr instanceof PointerIndirectionExpr
721- }
718+ override PointerIndirectionExpr expr ;
722719
723720 override TranslatedExpr getOperand ( ) { result = getTranslatedExpr ( expr .getOperand ( ) ) }
724721}
725722
726723class TranslatedAddressExpr extends TranslatedPointerOps {
727- TranslatedAddressExpr ( ) {
728- // &x is the same as x.
729- expr instanceof AddressOfExpr
730- }
724+ override AddressOfExpr expr ;
731725
732726 override TranslatedExpr getOperand ( ) { result = getTranslatedExpr ( expr .getOperand ( ) ) }
733727}
@@ -834,7 +828,7 @@ abstract class TranslatedVariableAccess extends TranslatedNonConstantExpr {
834828 * Some variable accesses need an extra load, eg. ref parameters,
835829 * out parameters
836830 */
837- final predicate needsExtraLoad ( ) {
831+ final private predicate needsExtraLoad ( ) {
838832 (
839833 expr .getTarget ( ) .( Parameter ) .isOutOrRef ( ) or
840834 expr .getTarget ( ) .( Parameter ) .isIn ( )
@@ -2068,9 +2062,9 @@ abstract class TranslatedCreation extends TranslatedCoreExpr, TTranslatedCreatio
20682062 final override Instruction getFirstInstruction ( ) { result = this .getInstruction ( NewObjTag ( ) ) }
20692063
20702064 override Instruction getResult ( ) {
2071- if not this .needsLoad ( )
2072- then result = this .getInstruction ( NewObjTag ( ) )
2073- else result = this .getInstruction ( LoadTag ( ) )
2065+ if this .needsLoad ( )
2066+ then result = this .getInstruction ( LoadTag ( ) )
2067+ else result = this .getInstruction ( NewObjTag ( ) )
20742068 }
20752069
20762070 override Instruction getReceiver ( ) { result = getInstruction ( NewObjTag ( ) ) }
@@ -2111,9 +2105,9 @@ abstract class TranslatedCreation extends TranslatedCoreExpr, TTranslatedCreatio
21112105 }
21122106
21132107 private Instruction getLoadOrChildSuccessor ( ) {
2114- if not this .needsLoad ( )
2115- then result = this .getParent ( ) . getChildSuccessor ( this )
2116- else result = this .getInstruction ( LoadTag ( ) )
2108+ if this .needsLoad ( )
2109+ then result = this .getInstruction ( LoadTag ( ) )
2110+ else result = this .getParent ( ) . getChildSuccessor ( this )
21172111 }
21182112
21192113 abstract TranslatedElement getConstructorCall ( ) ;
0 commit comments