Пример #1
0
 public StructureConstant getStruct() {
   ArrayConstantBuilder table = new ArrayConstantBuilder(I8_PTR);
   for (int i = 0; i < entries.length; i++) {
     table.add(new ConstantBitcast(BC_ABSTRACT_METHOD_CALLED, I8_PTR));
   }
   return new StructureConstantBuilder()
       .add(new IntegerConstant((short) entries.length))
       .add(table.build())
       .build();
 }
Пример #2
0
 public StructureConstant getStruct(SootClass clazz) {
   if (clazz.isInterface()) {
     throw new IllegalArgumentException("Expected a class got an interface: " + clazz.getName());
   }
   ArrayConstantBuilder table = new ArrayConstantBuilder(I8_PTR);
   for (Entry entry : entries) {
     ResolvedEntry resolvedEntry = entry.resolve(clazz);
     if (resolvedEntry == null || Modifier.isAbstract(resolvedEntry.getModifiers())) {
       table.add(new ConstantBitcast(BC_ABSTRACT_METHOD_CALLED, I8_PTR));
     } else if (!Modifier.isPublic(resolvedEntry.getModifiers())) {
       table.add(new ConstantBitcast(BC_NON_PUBLIC_METHOD_CALLED, I8_PTR));
     } else {
       table.add(new ConstantBitcast(resolvedEntry.getFunctionRef(), I8_PTR));
     }
   }
   return new StructureConstantBuilder()
       .add(new IntegerConstant((short) entries.length))
       .add(table.build())
       .build();
 }