@Override public void visitUnaryExpr(UnaryExpr unaryExpr) { if (unaryExpr.getOp().isSideEffecting()) { enterLValueContext(); } super.visitUnaryExpr(unaryExpr); if (unaryExpr.getOp().isSideEffecting()) { exitLValueContext(); } }
@Override public void visitUnaryExpr(UnaryExpr unaryExpr) { if (unaryExpr.getOp().isSideEffecting()) { predicateHolds(); } super.visitUnaryExpr(unaryExpr); }
/** * Determines whether the given statement came from a live code injection. * * @param stmt A statement to be analysed * @return Whether the statement is injected live code or not */ public static boolean isSimpleLiveCodeInjection(Stmt stmt) { if (!(stmt instanceof ExprStmt)) { return false; } final Expr expr = ((ExprStmt) stmt).getExpr(); if (expr instanceof BinaryExpr) { if (!((BinaryExpr) expr).getOp().isSideEffecting()) { return false; } return isLiveInjectionVariableReference(((BinaryExpr) expr).getLhs()); } if (expr instanceof UnaryExpr) { if (!((UnaryExpr) expr).getOp().isSideEffecting()) { return false; } return isLiveInjectionVariableReference(((UnaryExpr) expr).getExpr()); } if (expr instanceof FunctionCallExpr) { return ((FunctionCallExpr) expr).getCallee().startsWith(Constants.LIVE_PREFIX); } return false; }