本文整理汇总了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();
}
示例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);
}
示例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);
}
}
示例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);
}
示例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));
}
}
示例6: visit
import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
@Override
public void visit(Value e) {
if (e instanceof NewMultiArrayExpr) {
MAXZ = ((NewMultiArrayExpr) e).getSizes().size();
fill();
}
}
示例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));
}
}
}
示例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());
}
}
示例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);
}
}
示例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();
}
}
示例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();
}
示例12: caseNewMultiArrayExpr
import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
@Override
public void caseNewMultiArrayExpr(NewMultiArrayExpr v) {
throw new RuntimeException("todo");
}
示例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);
}
示例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()));
}
示例15: caseNewMultiArrayExpr
import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
@Override
public void caseNewMultiArrayExpr(NewMultiArrayExpr arg0) {
throw new RuntimeException("Must be handeled in SootStmtSwitch");
}