本文整理汇总了Java中soot.jimple.NewMultiArrayExpr类的典型用法代码示例。如果您正苦于以下问题:Java NewMultiArrayExpr类的具体用法?Java NewMultiArrayExpr怎么用?Java NewMultiArrayExpr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NewMultiArrayExpr类属于soot.jimple包,在下文中一共展示了NewMultiArrayExpr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: translateAssignment
import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
public static void translateAssignment(SootStmtSwitch ss, Value lhs,
Value rhs, Unit statement) {
ProgramFactory pf = GlobalsCache.v().getPf();
SootValueSwitch valueswitch = ss.getValueSwitch();
if (rhs instanceof InvokeExpr) {
InvokeExpr ivk = (InvokeExpr) rhs;
InvokeTranslation
.translateInvokeAssignment(ss, lhs, ivk, statement);
return;
}
valueswitch.isLeftHandSide = true;
lhs.apply(valueswitch);
valueswitch.isLeftHandSide = false;
Expression left = valueswitch.getExpression();
Expression right;
if (rhs instanceof NewExpr) {
right = ss.createAllocatedVariable(((NewExpr) rhs).getBaseType());
} else if (rhs instanceof NewArrayExpr) {
NewArrayExpr nae = (NewArrayExpr) rhs;
right = ss.createAllocatedVariable(nae.getType());
nae.getSize().apply(valueswitch);
Expression sizeexp = valueswitch.getExpression();
// add the size expression.
ss.addStatement(GlobalsCache.v().setArraySizeStatement(right,
sizeexp));
} else if (rhs instanceof NewMultiArrayExpr) {
NewMultiArrayExpr nmae = (NewMultiArrayExpr) rhs;
for (int i = 0; i < nmae.getSizeCount(); i++) {
nmae.getSize(i).apply(valueswitch);
// Expression sizeexp = valueswitch.getExpression();
// TODO
Log.debug("Mulit-arrays are not implemented!");
}
right = GlobalsCache.v().makeFreshGlobal(
SootPrelude.v().getReferenceType(), true, true);
} else if (rhs instanceof StringConstant) {
StringConstant str = (StringConstant) rhs;
// right = stringConstantMap.get(str);
right = ss.createAllocatedVariable(rhs.getType());
Expression[] indices = { right };
// assign the size of the string to the appropriate field in the
// $stringSizeHeapVariable array.
translateAssignment(
ss,
SootPrelude.v().getStringSizeHeapVariable(),
pf.mkArrayStoreExpression(SootPrelude.v()
.getStringSizeHeapVariable().getType(), SootPrelude
.v().getStringSizeHeapVariable(), indices, pf
.mkIntLiteral(Integer.toString(str.value.length()))));
} else {
rhs.apply(valueswitch);
right = valueswitch.getExpression();
}
translateAssignment(ss, left, right);
}
开发者ID:SRI-CSL,项目名称:bixie,代码行数:62,代码来源:AssignmentTranslation.java
示例17: caseNewMultiArrayStmt
import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
/** A new multi array statement */
protected void caseNewMultiArrayStmt( Local dest, NewMultiArrayExpr e ) {}
开发者ID:petablox-project,项目名称:petablox,代码行数:3,代码来源:FGStmtSwitch.java
示例18: caseAssignStmt
import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
public final void caseAssignStmt( AssignStmt s ) {
statement = s;
Value lhs = s.getLeftOp();
Value rhs = s.getRightOp();
if( ! (lhs.getType() instanceof RefType)
&& ! (lhs.getType() instanceof ArrayType) ) {
if( rhs instanceof InvokeExpr ) {
caseInvokeStmt( null, (InvokeExpr) rhs );
return;
}
caseUninterestingStmt( s );
return;
}
if( rhs instanceof InvokeExpr ) {
caseInvokeStmt( (Local) lhs, (InvokeExpr) rhs );
return;
}
if( lhs instanceof Local ) {
if( rhs instanceof Local ) {
caseCopyStmt( (Local) lhs, rhs );
} else if( rhs instanceof InstanceFieldRef ) {
caseLoadStmt( (Local) lhs, (InstanceFieldRef) rhs );
} else if( rhs instanceof ArrayRef ) {
caseArrayLoadStmt( (Local) lhs, (ArrayRef) rhs );
} else if( rhs instanceof StaticFieldRef ) {
caseGlobalLoadStmt( (Local) lhs, (StaticFieldRef) rhs );
} else if( rhs instanceof NewExpr ) {
caseNewStmt( (Local) lhs, (NewExpr) rhs );
} else if( rhs instanceof NewArrayExpr ) {
caseNewArrayStmt( (Local) lhs, (NewArrayExpr) rhs );
} else if( rhs instanceof NewMultiArrayExpr ) {
caseNewMultiArrayStmt( (Local) lhs, (NewMultiArrayExpr) rhs );
} else if( rhs instanceof CastExpr ) {
CastExpr r = (CastExpr) rhs;
Value rv = r.getOp();
caseCastStmt( (Local) lhs, rv, r );
} else if( rhs instanceof Constant ) {
caseCopyStmt( (Local) lhs, rhs );
} else if( rhs instanceof PhiExpr ) {
casePhiStmt( (Local) lhs, (PhiExpr) rhs );
} else throw new RuntimeException( "unhandled stmt "+s );
} else if( lhs instanceof InstanceFieldRef ) {
if( rhs instanceof Local || rhs instanceof Constant) {
caseStoreStmt( (InstanceFieldRef) lhs, rhs );
} else throw new RuntimeException( "unhandled stmt "+s );
} else if( lhs instanceof ArrayRef ) {
if( rhs instanceof Local || rhs instanceof Constant ) {
caseArrayStoreStmt( (ArrayRef) lhs, rhs );
} else throw new RuntimeException( "unhandled stmt "+s );
} else if( lhs instanceof StaticFieldRef ) {
if( rhs instanceof Local || rhs instanceof Constant ) {
caseGlobalStoreStmt( (StaticFieldRef) lhs, rhs );
} else throw new RuntimeException( "unhandled stmt "+s );
} else throw new RuntimeException( "unhandled stmt "+s );
}
开发者ID:petablox-project,项目名称:petablox,代码行数:56,代码来源:FGStmtSwitch.java
示例19: translateAssignment
import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
public static void translateAssignment(SootStmtSwitch ss, Value lhs,
Value rhs, Unit statement) {
ProgramFactory pf = GlobalsCache.v().getPf();
SootValueSwitch valueswitch = ss.getValueSwitch();
if (rhs instanceof InvokeExpr) {
InvokeExpr ivk = (InvokeExpr) rhs;
InvokeTranslation
.translateInvokeAssignment(ss, lhs, ivk, statement);
return;
}
valueswitch.isLeftHandSide = true;
lhs.apply(valueswitch);
valueswitch.isLeftHandSide = false;
Expression left = valueswitch.getExpression();
Expression right;
if (rhs instanceof NewExpr) {
right = ss.createAllocatedVariable(((NewExpr) rhs).getBaseType());
} else if (rhs instanceof NewArrayExpr) {
NewArrayExpr nae = (NewArrayExpr) rhs;
right = ss.createAllocatedVariable(nae.getType());
nae.getSize().apply(valueswitch);
Expression sizeexp = valueswitch.getExpression();
// add the size expression.
ss.addStatement(GlobalsCache.v().setArraySizeStatement(right,
sizeexp));
} else if (rhs instanceof NewMultiArrayExpr) {
NewMultiArrayExpr nmae = (NewMultiArrayExpr) rhs;
for (int i = 0; i < nmae.getSizeCount(); i++) {
nmae.getSize(i).apply(valueswitch);
// Expression sizeexp = valueswitch.getExpression();
// TODO
Log.error("Mulit-arrays are not implemented!");
}
right = GlobalsCache.v().makeFreshGlobal(
SootPrelude.v().getReferenceType(), true, true);
} else if (rhs instanceof StringConstant) {
StringConstant str = (StringConstant) rhs;
// right = stringConstantMap.get(str);
right = ss.createAllocatedVariable(rhs.getType());
Expression[] indices = { right };
// assign the size of the string to the appropriate field in the
// $stringSizeHeapVariable array.
translateAssignment(
ss,
SootPrelude.v().getStringSizeHeapVariable(),
pf.mkArrayStoreExpression(SootPrelude.v()
.getStringSizeHeapVariable().getType(), SootPrelude
.v().getStringSizeHeapVariable(), indices, pf
.mkIntLiteral(Integer.toString(str.value.length()))));
} else {
rhs.apply(valueswitch);
right = valueswitch.getExpression();
}
translateAssignment(ss, left, right);
}
开发者ID:martinschaef,项目名称:jar2bpl,代码行数:62,代码来源:AssignmentTranslation.java
示例20: caseNewMultiArrayExpr
import soot.jimple.NewMultiArrayExpr; //导入依赖的package包/类
@Override
public void caseNewMultiArrayExpr(NewMultiArrayExpr v) {
throwInvalidWriteException(v);
}
开发者ID:proglang,项目名称:jgs,代码行数:5,代码来源:SecurityConstraintValueWriteSwitch.java
注:本文中的soot.jimple.NewMultiArrayExpr类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论