当前位置: 首页>>代码示例>>Java>>正文


Java NewMultiArrayExpr类代码示例

本文整理汇总了Java中soot.jimple.NewMultiArrayExpr的典型用法代码示例。如果您正苦于以下问题:Java NewMultiArrayExpr类的具体用法?Java NewMultiArrayExpr怎么用?Java NewMultiArrayExpr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NewMultiArrayExpr类属于soot.jimple包,在下文中一共展示了NewMultiArrayExpr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: caseNewMultiArrayExpr

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
public void caseNewMultiArrayExpr(NewMultiArrayExpr v) {
	p.openBlock();
	String oldName = varName; 
	
	ttp.setVariableName("arrayType");
	v.getType().apply(ttp);
	
	p.println("List<IntConstant> sizes = new LinkedList<IntConstant>();");
	int i=0;
	for(Value s: v.getSizes()) {
		this.suggestVariableName("size"+i);
		s.apply(this);
		i++;
		
		p.println("sizes.add(sizes"+i+");");
	}
	
	p.println("Value "+oldName+" = Jimple.v().newNewMultiArrayExpr(arrayType, sizes);");
	varName = oldName;
	p.closeBlock();
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:22,代码来源:ValueTemplatePrinter.java

示例2: javafy_expr

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
private void javafy_expr(ValueBox vb) {
	Expr e = (Expr) vb.getValue();

	if (e instanceof BinopExpr)
		javafy_binop_expr(vb);
	else if (e instanceof UnopExpr)
		javafy_unop_expr(vb);
	else if (e instanceof CastExpr)
		javafy_cast_expr(vb);
	else if (e instanceof NewArrayExpr)
		javafy_newarray_expr(vb);
	else if (e instanceof NewMultiArrayExpr)
		javafy_newmultiarray_expr(vb);
	else if (e instanceof InstanceOfExpr)
		javafy_instanceof_expr(vb);
	else if (e instanceof InvokeExpr)
		javafy_invoke_expr(vb);
	else if (e instanceof NewExpr)
		javafy_new_expr(vb);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:21,代码来源:DavaBody.java

示例3: handleRefTypeAssignment

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
private void handleRefTypeAssignment(DefinitionStmt assignStmt, AnalysisInfo out) {
	Value left = assignStmt.getLeftOp();
	Value right = assignStmt.getRightOp();
	
	//unbox casted value
	if(right instanceof JCastExpr) {
		JCastExpr castExpr = (JCastExpr) right;
		right = castExpr.getOp();
	}
	
	//if we have a definition (assignment) statement to a ref-like type, handle it,
	if ( isAlwaysNonNull(right)
	|| right instanceof NewExpr || right instanceof NewArrayExpr
	|| right instanceof NewMultiArrayExpr || right instanceof ThisRef
	|| right instanceof StringConstant || right instanceof ClassConstant
	|| right instanceof CaughtExceptionRef) {
		//if we assign new... or @this, the result is non-null
		out.put(left,NON_NULL);
	} else if(right==NullConstant.v()) {
		//if we assign null, well, it's null
		out.put(left, NULL);
	} else if(left instanceof Local && right instanceof Local) {
		out.put(left, out.get(right));
	} else {
		out.put(left, TOP);
	}
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:28,代码来源:NullnessAnalysis.java

示例4: caseNewMultiArrayExpr

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
@Override
public void caseNewMultiArrayExpr(NewMultiArrayExpr nmae) {
	constantV.setOrigStmt(origStmt);
	// get array dimensions
	if (nmae.getSizeCount() > 255) {
		throw new RuntimeException("number of dimensions is too high (> 255) for the filled-new-array* opcodes: " + nmae.getSizeCount());
	}
	short dimensions = (short) nmae.getSizeCount();
	// get array base type
	ArrayType arrayType = ArrayType.v(nmae.getBaseType().baseType, dimensions);
	BuilderReference arrayTypeItem = DexPrinter.toTypeReference
			(arrayType, stmtV.getBelongingFile());
	// get the dimension size registers
	List<Register> dimensionSizeRegs = new ArrayList<Register>();
	for (int i = 0; i < dimensions; i++) {
		Value currentDimensionSize = nmae.getSize(i);
		Register currentReg = regAlloc.asImmediate(currentDimensionSize, constantV);
		dimensionSizeRegs.add(currentReg);
	}
	// create filled-new-array instruction, depending on the dimension sizes
	if (dimensions <= 5) {
		Register[] paddedRegs = pad35cRegs(dimensionSizeRegs);
           stmtV.addInsn(new Insn35c(Opcode.FILLED_NEW_ARRAY, dimensions, paddedRegs[0],
                   paddedRegs[1], paddedRegs[2], paddedRegs[3], paddedRegs[4], arrayTypeItem),
                   null);
	} else {
           stmtV.addInsn(new Insn3rc(Opcode.FILLED_NEW_ARRAY_RANGE, dimensionSizeRegs, dimensions,
                   arrayTypeItem), null);
	} // check for > 255 is done already
	// move the resulting array into the destination register
       stmtV.addInsn(new Insn11x(Opcode.MOVE_RESULT_OBJECT, destinationReg), origStmt);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:33,代码来源:ExprVisitor.java

示例5: caseNewMultiArrayExpr

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
public void caseNewMultiArrayExpr(NewMultiArrayExpr expr) {
    result = result.add(mgr.RESOLVE_CLASS_ERRORS);
    for (int i = 0; i < expr.getSizeCount(); i++) {
	Value count = expr.getSize(i);
	if ((! (count instanceof IntConstant)) ||
	    (((IntConstant) count).lessThan(INT_CONSTANT_ZERO)
	                          .equals(INT_CONSTANT_ZERO))) {
	    result = result.add(mgr.NEGATIVE_ARRAY_SIZE_EXCEPTION);
	}
	result = result.add(mightThrow(count));
    }
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:13,代码来源:UnitThrowAnalysis.java

示例6: visit

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
@Override
public void visit(Value e) {
    if (e instanceof NewMultiArrayExpr) {
        MAXZ = ((NewMultiArrayExpr) e).getSizes().size();
        fill();
    }
}
 
开发者ID:petablox-project,项目名称:petablox,代码行数:8,代码来源:DomArrDimension.java

示例7: visit

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
@Override
public void visit(Value e) { 
	if (e instanceof NewMultiArrayExpr) {
		NewMultiArrayExpr nmae = (NewMultiArrayExpr) e;
		for (int i = 0; i < nmae.getSizeCount(); i++) {
			add(nmae, i, nmae.getSize(i));
		}
	}
}
 
开发者ID:petablox-project,项目名称:petablox,代码行数:10,代码来源:RelNewMutliArrSize.java

示例8: visit

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
@Override
public void visit(Value e) { 
    if (e instanceof NewMultiArrayExpr) {
        NewMultiArrayExpr nmae = (NewMultiArrayExpr) e;
        add(e, e.getType(), nmae.getSizeCount());
    }
}
 
开发者ID:petablox-project,项目名称:petablox,代码行数:8,代码来源:RelNewMutliArrExpr.java

示例9: caseNewMultiArrayExpr

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
/**
 * DOC
 * 
 * @see soot.jimple.ExprSwitch#caseNewMultiArrayExpr(soot.jimple.NewMultiArrayExpr)
 */
@Override
public void caseNewMultiArrayExpr(NewMultiArrayExpr v) {
    for (int i = 0; i < v.getSizeCount(); i++) {
        v.getSize(i).apply(this);
    }
}
 
开发者ID:proglang,项目名称:jgs,代码行数:12,代码来源:AnnotationValueSwitch.java

示例10: caseNewMultiArrayExpr

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
@Override
public void caseNewMultiArrayExpr(NewMultiArrayExpr v) {
	rightElement = RightElement.NEW_ARRAY;
	logger.finest("New Multiarray expression identified: " + callingStmt.toString());
	if (actualContext == StmtContext.ASSIGNRIGHT) {
		new InternalAnalyzerException();
	}
}
 
开发者ID:proglang,项目名称:jgs,代码行数:9,代码来源:AnnotationValueSwitch.java

示例11: assignNew

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
/**
 * Assigns a root variable to a new object at a given allocation site.
 */
public void assignNew(Local lhs, AnyNewExpr allocSite) {
	
	// If creating a new string or class, re-use the constant site
	if (allocSite != SUMMARY_NODE) {
		if (allocSite.getType().equals(STRING_CONST.getType())) {
			allocSite = STRING_SITE;
		} else if (allocSite.getType().equals(CLASS_CONST.getType())) {
			allocSite = CLASS_SITE;
		}
	}
	
	// We do not handle multi-dimensional arrays in this version
	if (allocSite instanceof NewMultiArrayExpr) {
		allocSite = SUMMARY_NODE;
	}

	// Create this node in the heap, if it doesn't already exist
	newNode(allocSite, false);
	
	// Assign LHS to the new node
	Set<AnyNewExpr> target = new HashSet<AnyNewExpr>();
	target.add(allocSite);
	roots.put(lhs, Collections.unmodifiableSet(target));

	// Ensure reachability.
	gc();
}
 
开发者ID:rohanpadhye,项目名称:vasco,代码行数:31,代码来源:PointsToGraph.java

示例12: caseNewMultiArrayExpr

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
@Override
public void caseNewMultiArrayExpr(NewMultiArrayExpr v) {
	throw new RuntimeException("todo");
	
}
 
开发者ID:srasthofer,项目名称:FuzzDroid,代码行数:6,代码来源:JimpleExprVisitorImpl.java

示例13: isAllocationSite

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
private boolean isAllocationSite(Value val) {
  return (val instanceof StringConstant || val instanceof NewExpr || val instanceof NewArrayExpr || val instanceof NewMultiArrayExpr);
}
 
开发者ID:themaplelab,项目名称:boomerang,代码行数:4,代码来源:BackwardFlowFunctions.java

示例14: javafy_newmultiarray_expr

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
private void javafy_newmultiarray_expr(ValueBox vb) {
	NewMultiArrayExpr nmae = (NewMultiArrayExpr) vb.getValue();
	for (int i = 0; i < nmae.getSizeCount(); i++)
		javafy(nmae.getSizeBox(i));
	vb.setValue(new DNewMultiArrayExpr(nmae.getBaseType(), nmae	.getSizes()));
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:7,代码来源:DavaBody.java

示例15: caseNewMultiArrayExpr

import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
@Override
public void caseNewMultiArrayExpr(NewMultiArrayExpr arg0) {
	throw new RuntimeException("Must be handeled in SootStmtSwitch");
}
 
开发者ID:SRI-CSL,项目名称:bixie,代码行数:5,代码来源:SootValueSwitch.java


注:本文中的soot.jimple.NewMultiArrayExpr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。